Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 48115:4550144b1560 legacy-trunk
#3479: unichr(2**32) used to return u'\x00'.
The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int.
(why doesn't gcc issue a truncation warning in this case?)
| author | Amaury Forgeot d'Arc <amauryfa@gmail.com> |
|---|---|
| date | Thu, 31 Jul 2008 21:28:03 +0000 |
| parents | 3ada46f2321d |
| children | 5508862a1de5 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Thu Jul 31 17:17:14 2008 +0000 +++ b/Python/bltinmodule.c Thu Jul 31 21:28:03 2008 +0000 @@ -394,9 +394,9 @@ static PyObject * builtin_unichr(PyObject *self, PyObject *args) { - long x; - - if (!PyArg_ParseTuple(args, "l:unichr", &x)) + int x; + + if (!PyArg_ParseTuple(args, "i:unichr", &x)) return NULL; return PyUnicode_FromOrdinal(x);
