]> granicus.if.org Git - python/commitdiff
ignore classic classes
authorBenjamin Peterson <benjamin@python.org>
Sat, 9 May 2009 16:51:51 +0000 (16:51 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 9 May 2009 16:51:51 +0000 (16:51 +0000)
Objects/abstract.c

index c2d8db71fdbc56be7ec4d91f1b3d7840d81b4f7e..99b22db71bad23e559684b6a928c08b55dc97acf 100644 (file)
@@ -107,6 +107,8 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
                PyErr_Clear();
        }
 
+       if (PyInstance_Check(o))
+               return defaultvalue;
        /* try o.__length_hint__() */
         hintmeth = _PyObject_LookupSpecial(o, "__length_hint__", &hintstrobj);
        if (hintmeth == NULL)