[pypy-svn] r73813 - pypy/branch/cpython-extension/pypy/module/cpyext

afa at codespeak.net afa at codespeak.net
Fri Apr 16 16:21:46 CEST 2010


Author: afa
Date: Fri Apr 16 16:21:36 2010
New Revision: 73813

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py
Log:
Remove a check: "flags & Py_TPFLAGS_HAVE_CLASS"
is here for binary compatibility across cpython releases,
so that a recent python can load modules compiled before the introduction of tp_new.
This does not concern pypy.


Modified: pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py	Fri Apr 16 16:21:36 2010
@@ -192,14 +192,11 @@
 def inherit_special(space, pto, base_pto):
     # XXX missing: copy basicsize and flags in a magical way
     flags = rffi.cast(lltype.Signed, pto.c_tp_flags)
-    if True or flags & Py_TPFLAGS_HAVE_CLASS: # XXX i do not understand this check
-        base_object_pyo = make_ref(space, space.w_object, steal=True)
-        base_object_pto = rffi.cast(PyTypeObjectPtr, base_object_pyo)
-        if base_pto != base_object_pto or \
-                flags & Py_TPFLAGS_HEAPTYPE:
-            if not pto.c_tp_new:
-                pto.c_tp_new = base_pto.c_tp_new
-
+    base_object_pyo = make_ref(space, space.w_object, steal=True)
+    base_object_pto = rffi.cast(PyTypeObjectPtr, base_object_pyo)
+    if base_pto != base_object_pto or flags & Py_TPFLAGS_HEAPTYPE:
+        if not pto.c_tp_new:
+            pto.c_tp_new = base_pto.c_tp_new
 
 class __extend__(W_Root):
     __metaclass__ = extendabletype



More information about the Pypy-commit mailing list