From c352620c92d2efcdf4940909d6de81cf9c336e0b Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 28 May 2016 14:04:40 -0700 Subject: backout 3c9512d8ac0d --- Lib/test/test_descr.py | 8 -------- Misc/NEWS | 2 -- Objects/typeobject.c | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 92767ec..a130cec 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4564,14 +4564,6 @@ order (MRO) for bases """ self.assertRegex(repr(method), r">") - def test_deleting_new_in_subclasses(self): - class X: - def __init__(self, a): - pass - X.__new__ = None - del X.__new__ - X(1) # should work - class DictProxyTests(unittest.TestCase): def setUp(self): diff --git a/Misc/NEWS b/Misc/NEWS index cd63239..1c479ce 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -80,8 +80,6 @@ Core and Builtins (``int``) and ``f2()`` returns ``1.0`` (``int``), even if ``1`` and ``1.0`` are equal. -- Issue #25731: Fix set and deleting __new__ on a class. - - Issue #22995: [UPDATE] Comment out the one of the pickleability tests in _PyObject_GetState() due to regressions observed in Cython-based projects. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 0a82f3a..19e6596 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6777,7 +6777,7 @@ update_one_slot(PyTypeObject *type, slotdef *p) sanity checks and constructing a new argument list. Cut all that nonsense short -- this speeds up instance creation tremendously. */ - specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new; + specific = (void *)type->tp_new; /* XXX I'm not 100% sure that there isn't a hole in this reasoning that requires additional sanity checks. I'll buy the first person to -- cgit v0.12