]> granicus.if.org Git - python/commitdiff
PyFunction_Call() did not check the result of PyObject_Repr() for NULL, and
authorFred Drake <fdrake@acm.org>
Thu, 1 Nov 2001 20:26:12 +0000 (20:26 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 1 Nov 2001 20:26:12 +0000 (20:26 +0000)
should just avoid calling it in the first place to avoid waiting for a repr
of a large object like a dict or list.  The result of PyObject_Repr() was
being leaked as well.
Bugfix candidate!

Objects/abstract.c

index 9f4a13f68d461e71a71770b48db62653d7314181..938c2e26cad3689ac7d57dd400a54fc4e6d69cf3 100644 (file)
@@ -1660,8 +1660,8 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw)
                                "NULL result without error in PyObject_Call");
                return result;
        }
-       PyErr_Format(PyExc_TypeError, "object is not callable: %s",
-                    PyString_AS_STRING(PyObject_Repr(func)));
+       PyErr_Format(PyExc_TypeError, "'%s' object is not callable",
+                    func->ob_type->tp_name);
        return NULL;
 }