Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 573395a

Browse files
committed
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!
1 parent d2364e8 commit 573395a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Objects/abstract.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,8 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw)
16601660
"NULL result without error in PyObject_Call");
16611661
return result;
16621662
}
1663-
PyErr_Format(PyExc_TypeError, "object is not callable: %s",
1664-
PyString_AS_STRING(PyObject_Repr(func)));
1663+
PyErr_Format(PyExc_TypeError, "'%s' object is not callable",
1664+
func->ob_type->tp_name);
16651665
return NULL;
16661666
}
16671667

0 commit comments

Comments
 (0)