]> granicus.if.org Git - python/commitdiff
declarations to the top of the block
authorBenjamin Peterson <benjamin@python.org>
Fri, 2 Dec 2016 08:02:24 +0000 (00:02 -0800)
committerBenjamin Peterson <benjamin@python.org>
Fri, 2 Dec 2016 08:02:24 +0000 (00:02 -0800)
Objects/typeobject.c

index 69a996a8fd8c303afcce35ca8d723c1581e38250..738ff864c81eee572fd93fe7440c4575d2763acd 100644 (file)
@@ -6314,12 +6314,12 @@ update_one_slot(PyTypeObject *type, slotdef *p)
                 specific = (void *)slot_tp_new;
             }
             else {
+                PyTypeObject *staticbase = type->tp_base;
                 specific = ((PyTypeObject *)self)->tp_new;
                 /* Check that the user does not do anything
                    silly and unsafe like object.__new__(dict).
                    To do this, we check that the most derived
                    base that's not a heap type is this type. */
-                PyTypeObject *staticbase = type->tp_base;
                 while (staticbase &&
                        (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE))
                     staticbase = staticbase->tp_base;