mirror of
https://github.com/python/cpython.git
synced 2025-09-10 18:58:35 +00:00
CHange error messages for ord(), using "string" instead of "string or Unicode"
This commit is contained in:
parent
4e36d5885b
commit
f07aad171a
1 changed files with 3 additions and 2 deletions
|
@ -1524,13 +1524,14 @@ builtin_ord(PyObject *self, PyObject *args)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"ord() expected string or Unicode character, " \
|
"ord() expected string of length 1, but " \
|
||||||
"%.200s found", obj->ob_type->tp_name);
|
"%.200s found", obj->ob_type->tp_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"ord() expected a character, length-%d string found",
|
"ord() expected a character, "
|
||||||
|
"but string of length %d found",
|
||||||
size);
|
size);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue