Commit eb423c09 authored by Stefan Behnel's avatar Stefan Behnel

avoid using PyDict_GetItemWithError in pypy3 (missing in its cpyext emulation)

parent 54693f22
......@@ -225,7 +225,7 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) {
/////////////// DictGetItem.proto ///////////////
#if PY_MAJOR_VERSION >= 3
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value;
value = PyDict_GetItemWithError(d, key);
......
......@@ -161,7 +161,7 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
PyObject* value;
#if PY_MAJOR_VERSION >= 3
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) {
if (unlikely(PyErr_Occurred()))
......@@ -207,7 +207,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
#else
if (is_safe_type == 1 || (is_safe_type == -1 &&
/* the following builtins presumably have repeatably safe and fast hash functions */
#if PY_MAJOR_VERSION >= 3
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
(PyUnicode_CheckExact(key) || PyString_CheckExact(key) || PyLong_CheckExact(key)))) {
value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) {
......
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