summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-02-10 15:46:50 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-02-10 15:46:50 (GMT)
commit4015f62e39452db0aa651edcd54b00f4e80e6bb5 (patch)
treef9d290763c2e993c0465d51a5f70387ff0598ccf /Objects/longobject.c
parent6a743d3694fb5138f5eab393c172c3b6789b0383 (diff)
downloadcpython-4015f62e39452db0aa651edcd54b00f4e80e6bb5.zip
cpython-4015f62e39452db0aa651edcd54b00f4e80e6bb5.tar.gz
cpython-4015f62e39452db0aa651edcd54b00f4e80e6bb5.tar.bz2
Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for
negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index fdbda6b..ddfa72b 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -557,7 +557,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 long to unsigned");
return -1;
}