projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1dfa9ac
)
PyPy compile fix for PyLong conversion
author
Stefan Behnel
<stefan_ml@behnel.de>
Tue, 6 Nov 2012 19:26:42 +0000
(20:26 +0100)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Tue, 6 Nov 2012 19:26:42 +0000
(20:26 +0100)
Cython/Compiler/PyrexTypes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/PyrexTypes.py
b/Cython/Compiler/PyrexTypes.py
index
c63c157
..
30137b3
100755
(executable)
--- a/
Cython/Compiler/PyrexTypes.py
+++ b/
Cython/Compiler/PyrexTypes.py
@@
-1454,6
+1454,10
@@
static CYTHON_INLINE %(type)s __Pyx_PyInt_from_py_%(TypeName)s(PyObject* x) {
else
return (%(type)s)__Pyx_PyInt_AsSignedLongLong(x);
} else {
+ #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+ #else
%(type)s val;
PyObject *v = __Pyx_PyNumber_Int(x);
#if PY_VERSION_HEX < 0x03000000
@@
-1473,6
+1477,7
@@
static CYTHON_INLINE %(type)s __Pyx_PyInt_from_py_%(TypeName)s(PyObject* x) {
if (likely(!ret))
return val;
}
+ #endif
return (%(type)s)-1;
}
}