[Python-checkins] r46808 - python/trunk/Objects/abstract.c

brett.cannon python-checkins at python.org
Sat Jun 10 00:45:54 CEST 2006


Author: brett.cannon
Date: Sat Jun 10 00:45:54 2006
New Revision: 46808

Modified:
   python/trunk/Objects/abstract.c
Log:
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.


Modified: python/trunk/Objects/abstract.c
==============================================================================
--- python/trunk/Objects/abstract.c	(original)
+++ python/trunk/Objects/abstract.c	Sat Jun 10 00:45:54 2006
@@ -1790,14 +1790,16 @@
         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(


More information about the Python-checkins mailing list