Re-apply patch #1700288 (first applied in r59931, rolled back in r59940)
now that ctypes uses a more supported method to create types:
Method cache optimization, by Armin Rigo, ported to 2.6 by Kevin Jacobs.
diff --git a/Objects/object.c b/Objects/object.c
index 788e732..dbe5658 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1287,6 +1287,7 @@
goto done;
}
+#if 0 /* XXX this is not quite _PyType_Lookup anymore */
/* Inline _PyType_Lookup */
{
Py_ssize_t i, n;
@@ -1311,6 +1312,9 @@
break;
}
}
+#else
+ descr = _PyType_Lookup(tp, name);
+#endif
Py_XINCREF(descr);