summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2006-06-09 22:45:54 (GMT)
committerBrett Cannon <bcannon@gmail.com>2006-06-09 22:45:54 (GMT)
commit6946ea0be032c17689ee35d3281060b8fe662471 (patch)
treef5efee4766df1ccbc0c9ab532db11ceaf151f09f /Objects/abstract.c
parent22565aac3b75dbdf255226b217097885e59e0fcb (diff)
downloadcpython-6946ea0be032c17689ee35d3281060b8fe662471.zip
cpython-6946ea0be032c17689ee35d3281060b8fe662471.tar.gz
cpython-6946ea0be032c17689ee35d3281060b8fe662471.tar.bz2
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 53898c5..e85fe20 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1790,14 +1790,16 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw)
ternaryfunc call;
if ((call = func->ob_type->tp_call) != NULL) {
+ PyObject *result = NULL;
/* slot_tp_call() will be called and ends up calling
PyObject_Call() if the object returned for __call__ has
__call__ itself defined upon it. This can be an infinite
recursion if you set __call__ in a class to an instance of
it. */
- if (Py_EnterRecursiveCall(" in __call__"))
+ if (Py_EnterRecursiveCall(" in __call__")) {
return NULL;
- PyObject *result = (*call)(func, arg, kw);
+ }
+ result = (*call)(func, arg, kw);
Py_LeaveRecursiveCall();
if (result == NULL && !PyErr_Occurred())
PyErr_SetString(