Author: Matti Picus <matti.pi...@gmail.com> Branch: issue2522 Changeset: r90819:c121ac248c57 Date: 2017-03-26 22:42 +0300 http://bitbucket.org/pypy/pypy/changeset/c121ac248c57/
Log: fix for -A, fix issue setting tp_new to 0x1 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 @@ -732,6 +732,7 @@ UnicodeSubtype2.tp_base = &UnicodeSubtype; MetaType.tp_base = &PyType_Type; + fooType.tp_new = &new_fooType; InitErrType.tp_new = PyType_GenericNew; if (PyType_Ready(&fooType) < 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 pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit