Author: Matti Picus <[email protected]>
Branch: 
Changeset: r90624:727fd362a2e6
Date: 2017-03-10 17:13 +0200
http://bitbucket.org/pypy/pypy/changeset/727fd362a2e6/

Log:    fix for cpython2 (arigato)

diff --git a/pypy/module/cpyext/test/test_typeobject.py 
b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -1165,7 +1165,7 @@
                 Base1->tp_basicsize = sizeof(PyHeapTypeObject);
                 Base2->tp_basicsize = sizeof(PyHeapTypeObject);
                 Base12->tp_basicsize = sizeof(PyHeapTypeObject);
-                #ifndef PYPY_VERSION /* PyHeapTypeObject has no ht_qualname on 
PyPy */
+                #ifndef PYPY_VERSION /* PyHeapTypeObject has no ht_qualname 
nor ht_name on PyPy */
                 #if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3
                 {
                   PyObject * dummyname = PyBytes_FromString("dummy name");
@@ -1173,6 +1173,13 @@
                   ((PyHeapTypeObject*)Base2)->ht_qualname = dummyname;
                   ((PyHeapTypeObject*)Base12)->ht_qualname = dummyname;
                 }
+                #elif PY_MAJOR_VERSION == 2
+                {
+                  PyObject * dummyname = PyBytes_FromString("dummy name");
+                  ((PyHeapTypeObject*)Base1)->ht_name = dummyname;
+                  ((PyHeapTypeObject*)Base2)->ht_name = dummyname;
+                  ((PyHeapTypeObject*)Base12)->ht_name = dummyname;
+                }
                 #endif 
                 #endif 
                 Base1->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | 
Py_TPFLAGS_HEAPTYPE;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to