Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78782b3

Browse files
committed
PyPy compile fix for PyLong conversion
1 parent 1dfa9ac commit 78782b3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Cython/Compiler/PyrexTypes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,10 @@ def py_type_name(self):
14541454
else
14551455
return (%(type)s)__Pyx_PyInt_AsSignedLongLong(x);
14561456
} else {
1457+
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
1458+
PyErr_SetString(PyExc_RuntimeError,
1459+
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
1460+
#else
14571461
%(type)s val;
14581462
PyObject *v = __Pyx_PyNumber_Int(x);
14591463
#if PY_VERSION_HEX < 0x03000000
@@ -1473,6 +1477,7 @@ def py_type_name(self):
14731477
if (likely(!ret))
14741478
return val;
14751479
}
1480+
#endif
14761481
return (%(type)s)-1;
14771482
}
14781483
}

0 commit comments

Comments
 (0)