From 3f3d36bd035ca34f52a46e9bb8ad39fa6d7687b9 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 9 May 2009 16:51:51 +0000 Subject: [PATCH] ignore classic classes --- Objects/abstract.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Objects/abstract.c b/Objects/abstract.c index c2d8db71fdb..99b22db71ba 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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)