]> granicus.if.org Git - python/commitdiff
remove PyType_Ready call; float should be initialized in interpreter startup
authorBenjamin Peterson <benjamin@python.org>
Sat, 5 Jun 2010 00:38:22 +0000 (00:38 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 5 Jun 2010 00:38:22 +0000 (00:38 +0000)
Objects/abstract.c

index 898becd24580e6eedddc6680dad92063f2bdda4d..20d241ddc6880ac9f5b43f54d281b37c2ab31437 100644 (file)
@@ -752,11 +752,6 @@ PyObject_Format(PyObject* obj, PyObject *format_spec)
         goto done;
     }
 
-    /* Make sure the type is initialized.  float gets initialized late */
-    if (Py_TYPE(obj)->tp_dict == NULL)
-        if (PyType_Ready(Py_TYPE(obj)) < 0)
-            goto done;
-
     /* Check for a __format__ method and call it. */
     if (PyInstance_Check(obj)) {
         /* We're an instance of a classic class */
@@ -826,7 +821,7 @@ done1:
     } else {
         /* Not an instance of a classic class, use the code
            from py3k */
-        static PyObject *format_cache;
+        static PyObject *format_cache = NULL;
 
         /* Find the (unbound!) __format__ method (a borrowed
            reference) */