Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for
negative arguments. Previously, it raised TypeError.
Thanks Lisandro Dalcin.
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 @@
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;
}