]> granicus.if.org Git - python/commitdiff
Issue #8749: remove unused code in Objects/object.c. Thanks Yaniv Aknin.
authorMark Dickinson <dickinsm@gmail.com>
Sat, 22 May 2010 12:02:35 +0000 (12:02 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 22 May 2010 12:02:35 +0000 (12:02 +0000)
Objects/object.c

index 7907a8e566a35aa2b5d071f976e64a2f6146852d..0802348455b73c1fb5b06d73b0cc8193f5938103 100644 (file)
@@ -950,31 +950,7 @@ PyObject_GenericGetAttr(PyObject *obj, PyObject *name)
             goto done;
     }
 
-#if 0 /* XXX this is not quite _PyType_Lookup anymore */
-    /* Inline _PyType_Lookup */
-    {
-        Py_ssize_t i, n;
-        PyObject *mro, *base, *dict;
-
-        /* Look in tp_dict of types in MRO */
-        mro = tp->tp_mro;
-        assert(mro != NULL);
-        assert(PyTuple_Check(mro));
-        n = PyTuple_GET_SIZE(mro);
-        for (i = 0; i < n; i++) {
-            base = PyTuple_GET_ITEM(mro, i);
-            assert(PyType_Check(base));
-            dict = ((PyTypeObject *)base)->tp_dict;
-            assert(dict && PyDict_Check(dict));
-            descr = PyDict_GetItem(dict, name);
-            if (descr != NULL)
-                break;
-        }
-    }
-#else
     descr = _PyType_Lookup(tp, name);
-#endif
-
     Py_XINCREF(descr);
 
     f = NULL;