[Python-checkins] r71020 - python/branches/py3k/Python/symtable.c

benjamin.peterson python-checkins at python.org
Thu Apr 2 04:27:21 CEST 2009


Author: benjamin.peterson
Date: Thu Apr  2 04:27:20 2009
New Revision: 71020

Log:
rewrite error handling to make sense

Modified:
   python/branches/py3k/Python/symtable.c

Modified: python/branches/py3k/Python/symtable.c
==============================================================================
--- python/branches/py3k/Python/symtable.c	(original)
+++ python/branches/py3k/Python/symtable.c	Thu Apr  2 04:27:20 2009
@@ -824,14 +824,18 @@
 
 	if (!analyze_block(entry, temp_bound, temp_free, temp_global))
 		goto error;
-	success = PyNumber_InPlaceOr(child_free, temp_free) >= 0;
+	if (PyNumber_InPlaceOr(child_free, temp_free) < 0)
+		goto error;
 	Py_DECREF(child_free);
-	success = 1;
+	Py_DECREF(temp_bound);
+	Py_DECREF(temp_free);
+	Py_DECREF(temp_global);
+	return 1;
  error:
 	Py_XDECREF(temp_bound);
 	Py_XDECREF(temp_free);
 	Py_XDECREF(temp_global);
-	return success;
+	return 0;
 }
 
 static int


More information about the Python-checkins mailing list