mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Merged revisions 69498 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r69498 | mark.dickinson | 2009-02-10 15:46:50 +0000 (Tue, 10 Feb 2009) | 6 lines Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin. ........
This commit is contained in:
parent
eeba356308
commit
21776074cc
6 changed files with 39 additions and 10 deletions
|
@ -786,7 +786,7 @@ _PyLong_AsByteArray(PyLongObject* v,
|
|||
if (Py_SIZE(v) < 0) {
|
||||
ndigits = -(Py_SIZE(v));
|
||||
if (!is_signed) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"can't convert negative int to unsigned");
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue