diff Python/symtable.c @ 52707:bc15b483d384

rewrite error handling to make sense
author Benjamin Peterson <benjamin@python.org>
date Thu, 02 Apr 2009 02:27:20 +0000
parents 33eb1697c382
children a0e211b04b2e
line wrap: on
line diff
--- a/Python/symtable.c	Thu Apr 02 01:50:37 2009 +0000
+++ b/Python/symtable.c	Thu Apr 02 02:27:20 2009 +0000
@@ -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