Commit 60b326a6 authored by Stefan Behnel's avatar Stefan Behnel

Silence C compiler warning about unused utility functions in Py3.

parent 06bfe01d
...@@ -198,6 +198,8 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec ...@@ -198,6 +198,8 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec
value = default_value; value = default_value;
} }
Py_INCREF(value); Py_INCREF(value);
// avoid C compiler warning about unused utility functions
if ((1));
#else #else
if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
/* these presumably have safe hash functions */ /* these presumably have safe hash functions */
...@@ -206,13 +208,14 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec ...@@ -206,13 +208,14 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec
value = default_value; value = default_value;
} }
Py_INCREF(value); Py_INCREF(value);
} else { }
#endif
else {
if (default_value == Py_None) if (default_value == Py_None)
value = CALL_UNBOUND_METHOD(PyDict_Type, "get", d, key); value = CALL_UNBOUND_METHOD(PyDict_Type, "get", d, key);
else else
value = CALL_UNBOUND_METHOD(PyDict_Type, "get", d, key, default_value); value = CALL_UNBOUND_METHOD(PyDict_Type, "get", d, key, default_value);
} }
#endif
return value; return 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