]> granicus.if.org Git - python/commitdiff
backout 3c9512d8ac0d
authorBenjamin Peterson <benjamin@python.org>
Sat, 28 May 2016 21:04:40 +0000 (14:04 -0700)
committerBenjamin Peterson <benjamin@python.org>
Sat, 28 May 2016 21:04:40 +0000 (14:04 -0700)
Lib/test/test_descr.py
Misc/NEWS
Objects/typeobject.c

index 92767ec23118be994a3610ab1755927857535cc4..a130cecb89e34444953dc9acc6ed33864b837fb5 100644 (file)
@@ -4564,14 +4564,6 @@ order (MRO) for bases """
         self.assertRegex(repr(method),
             r"<bound method qualname of <object object at .*>>")
 
-    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):
index cd6323994cbcc545f5e48ca0286b7eb09be5a310..1c479ce88fa9e779c421dfd7a097da432911b6da 100644 (file)
--- 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.
 
index 0a82f3adea7f53c1617a3827aa7dc0879a752296..19e65963d58f5fade5b578f1d520b88642987092 100644 (file)
@@ -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