diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-07-06 18:39:44 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-07-06 18:39:44 (GMT) |
commit | f54d7811c3c7a204d7380cdda4fe503bc01b05fd (patch) | |
tree | a2fbf690880523138d9da34e88902d31003ee82c /Objects/bytesobject.c | |
parent | 0122ae9ac83afcad234aac80f77f90afabe342ea (diff) | |
download | cpython-f54d7811c3c7a204d7380cdda4fe503bc01b05fd.zip cpython-f54d7811c3c7a204d7380cdda4fe503bc01b05fd.tar.gz cpython-f54d7811c3c7a204d7380cdda4fe503bc01b05fd.tar.bz2 |
Issue #27460: Unified error messages in bytes constructor for integers
in and out of the Py_ssize_t range. Patch by Xiang Zhang.
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r-- | Objects/bytesobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 8ad2782..1ef21cc 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2624,7 +2624,7 @@ fail: \ for (i = 0; i < Py_SIZE(x); i++) { \ item = GET_ITEM((x), i); \ - value = PyNumber_AsSsize_t(item, PyExc_ValueError); \ + value = PyNumber_AsSsize_t(item, NULL); \ if (value == -1 && PyErr_Occurred()) \ goto error; \ \ @@ -2687,7 +2687,7 @@ _PyBytes_FromIterator(PyObject *it, PyObject *x) } /* Interpret it as an int (__index__) */ - value = PyNumber_AsSsize_t(item, PyExc_ValueError); + value = PyNumber_AsSsize_t(item, NULL); Py_DECREF(item); if (value == -1 && PyErr_Occurred()) goto error; |