summaryrefslogtreecommitdiff
path: root/Cython/Utility
diff options
context:
space:
mode:
Diffstat (limited to 'Cython/Utility')
-rw-r--r--Cython/Utility/ObjectHandling.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Cython/Utility/ObjectHandling.c b/Cython/Utility/ObjectHandling.c
index a90911142..8acc67bac 100644
--- a/Cython/Utility/ObjectHandling.c
+++ b/Cython/Utility/ObjectHandling.c
@@ -913,8 +913,10 @@ static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *na
if (PyDict_SetItem(dict, PYIDENT("__module__"), modname) < 0)
return NULL;
+#if PY_VERSION_HEX >= 0x03030000
if (PyDict_SetItem(dict, PYIDENT("__qualname__"), qualname) < 0)
return NULL;
+#endif
/* Python2 __metaclass__ */
metaclass = __Pyx_PyDict_GetItemStr(dict, PYIDENT("__metaclass__"));
@@ -974,7 +976,9 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases,
/* Required here to emulate assignment order */
if (unlikely(PyObject_SetItem(ns, PYIDENT("__module__"), modname) < 0)) goto bad;
+#if PY_VERSION_HEX >= 0x03030000
if (unlikely(PyObject_SetItem(ns, PYIDENT("__qualname__"), qualname) < 0)) goto bad;
+#endif
if (unlikely(doc && PyObject_SetItem(ns, PYIDENT("__doc__"), doc) < 0)) goto bad;
return ns;
bad: