Commit f0bc3768 authored by Stefan Behnel's avatar Stefan Behnel

Prevent incorrect coercion from digit-only strings to integers in fallback...

Prevent incorrect coercion from digit-only strings to integers in fallback code if slots are not used (e.g. in PyPy).
parent 121f7ab4
...@@ -338,7 +338,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { ...@@ -338,7 +338,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
} }
#endif #endif
#else #else
res = PyNumber_Int(x); if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
res = PyNumber_Int(x);
}
#endif #endif
if (likely(res)) { if (likely(res)) {
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment