Commit 81a4b1b1 authored by Stefan Behnel's avatar Stefan Behnel

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

--HG--
extra : transplant_source : %15%07%06%F7Tq%91%C6%A4%FA%11%DC%27%E9%0D%D7%FA%A1gx
parent a94ca702
...@@ -225,7 +225,7 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) { ...@@ -225,7 +225,7 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) {
/////////////// DictGetItem.proto /////////////// /////////////// 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) { static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value; PyObject *value;
value = PyDict_GetItemWithError(d, key); value = PyDict_GetItemWithError(d, key);
......
...@@ -161,7 +161,7 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec ...@@ -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) { static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
PyObject* value; PyObject* value;
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
value = PyDict_GetItemWithError(d, key); value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) { if (unlikely(!value)) {
if (unlikely(PyErr_Occurred())) if (unlikely(PyErr_Occurred()))
...@@ -207,7 +207,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke ...@@ -207,7 +207,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
#else #else
if (is_safe_type == 1 || (is_safe_type == -1 && if (is_safe_type == 1 || (is_safe_type == -1 &&
/* the following builtins presumably have repeatably safe and fast hash functions */ /* 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)))) { (PyUnicode_CheckExact(key) || PyString_CheckExact(key) || PyLong_CheckExact(key)))) {
value = PyDict_GetItemWithError(d, key); value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) { 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