Author: Matti Picus <[email protected]>
Branch: release-pypy2.7-5.x
Changeset: r90826:0c25bd7d5d7f
Date: 2017-03-27 19:29 +0300
http://bitbucket.org/pypy/pypy/changeset/0c25bd7d5d7f/

Log:    fix for -A, fix issue setting tp_new to 0x1 (grafted from
        c121ac248c57)

diff --git a/pypy/module/cpyext/test/foo.c b/pypy/module/cpyext/test/foo.c
--- a/pypy/module/cpyext/test/foo.c
+++ b/pypy/module/cpyext/test/foo.c
@@ -734,6 +734,9 @@
     UnicodeSubtype2.tp_base = &UnicodeSubtype;
     MetaType.tp_base = &PyType_Type;
 
+    footype.tp_new = &new_fooType;
+    InitErrType.tp_new = PyType_GenericNew;
+
     if (PyType_Ready(&footype) < 0)
         INITERROR;
     if (PyType_Ready(&UnicodeSubtype) < 0)
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
@@ -975,7 +975,7 @@
         class foo(f2, f1):
             pass
 
-        x = foo(1)
+        x = foo()
         assert bar.__base__ is f2
         # On cpython, the size changes.
         if '__pypy__' in sys.builtin_module_names:
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -770,10 +770,6 @@
         if pto.c_tp_itemsize < pto.c_tp_base.c_tp_itemsize:
             pto.c_tp_itemsize = pto.c_tp_base.c_tp_itemsize
 
-    if space.is_w(w_type, space.w_object):
-        # will be filled later on with the correct value
-        # may not be 0
-        pto.c_tp_new = cts.cast('newfunc', 1)
     update_all_slots(space, w_type, pto)
     if not pto.c_tp_new:
         base_object_pyo = make_ref(space, space.w_object)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to