Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.

This commit is contained in:
Brett Cannon 2006-06-09 22:45:54 +00:00
parent 22565aac3b
commit 6946ea0be0
1 changed files with 4 additions and 2 deletions

View File

@ -1790,14 +1790,16 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw)
ternaryfunc call; ternaryfunc call;
if ((call = func->ob_type->tp_call) != NULL) { if ((call = func->ob_type->tp_call) != NULL) {
PyObject *result = NULL;
/* slot_tp_call() will be called and ends up calling /* slot_tp_call() will be called and ends up calling
PyObject_Call() if the object returned for __call__ has PyObject_Call() if the object returned for __call__ has
__call__ itself defined upon it. This can be an infinite __call__ itself defined upon it. This can be an infinite
recursion if you set __call__ in a class to an instance of recursion if you set __call__ in a class to an instance of
it. */ it. */
if (Py_EnterRecursiveCall(" in __call__")) if (Py_EnterRecursiveCall(" in __call__")) {
return NULL; return NULL;
PyObject *result = (*call)(func, arg, kw); }
result = (*call)(func, arg, kw);
Py_LeaveRecursiveCall(); Py_LeaveRecursiveCall();
if (result == NULL && !PyErr_Occurred()) if (result == NULL && !PyErr_Occurred())
PyErr_SetString( PyErr_SetString(