[Python-Dev] Re: [Patches] [Patch #102955] bltinmodule.c warning fix
Tim Peters
tim.one@home.com
Sat, 23 Dec 2000 02:16:29 -0500
[Tim]
> So we should say "8-bit string" or "Unicode string" when *only*
> one of those is allowable.
[Andrew]
> OK... how about this patch?
+1 from me. And maybe if you offer to send a royalty to Marc-Andre each
time it's printed, he'll back down from wanting to use the error msgs as a
billboard <wink>.
> Index: bltinmodule.c
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v
> retrieving revision 2.185
> diff -u -r2.185 bltinmodule.c
> --- bltinmodule.c 2000/12/20 15:07:34 2.185
> +++ bltinmodule.c 2000/12/21 18:36:54
> @@ -1524,13 +1524,14 @@
> }
> } else {
> PyErr_Format(PyExc_TypeError,
> - "ord() expected string or Unicode character, " \
> + "ord() expected string of length 1, but " \
> "%.200s found", obj->ob_type->tp_name);
> return NULL;
> }
>
> PyErr_Format(PyExc_TypeError,
> - "ord() expected a character, length-%d string found",
> + "ord() expected a character, "
> + "but string of length %d found",
> size);
> return NULL;
> }