summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-11-01 20:26:12 (GMT)
committerFred Drake <fdrake@acm.org>2001-11-01 20:26:12 (GMT)
commit573395a7a8163c38630c5262ed3910c279e4a767 (patch)
tree48bacca27535af19f61c7d86fb7fa4009fae4a3e
parentd2364e8e2dee675526fb35b07dab0e8f84268ec3 (diff)
downloadcpython-573395a7a8163c38630c5262ed3910c279e4a767.zip
cpython-573395a7a8163c38630c5262ed3910c279e4a767.tar.gz
cpython-573395a7a8163c38630c5262ed3910c279e4a767.tar.bz2
PyFunction_Call() did not check the result of PyObject_Repr() for NULL, and
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!
-rw-r--r--Objects/abstract.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 9f4a13f..938c2e2 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -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;
}