projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1751da
)
raise OverflowError when converting negative value to unsigned long long
author
Lisandro Dalcin
<dalcinl@gmail.com>
Fri, 6 Feb 2009 19:29:28 +0000
(17:29 -0200)
committer
Lisandro Dalcin
<dalcinl@gmail.com>
Fri, 6 Feb 2009 19:29:28 +0000
(17:29 -0200)
Cython/Compiler/PyrexTypes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/PyrexTypes.py
b/Cython/Compiler/PyrexTypes.py
index aa48d03a3253350051f591640931ebf8c370c1c9..145efec4c972e3b777dec85aff975192b8468930 100644
(file)
--- a/
Cython/Compiler/PyrexTypes.py
+++ b/
Cython/Compiler/PyrexTypes.py
@@
-1426,7
+1426,7
@@
static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x)
if (PyInt_CheckExact(x)) {
long val = PyInt_AS_LONG(x);
if (unlikely(val < 0)) {
- PyErr_SetString(PyExc_
TypeError, "Negative assignment to unsigned type.
");
+ PyErr_SetString(PyExc_
OverflowError, "can't convert negative value to unsigned long long
");
return (unsigned PY_LONG_LONG)-1;
}
return val;