]> granicus.if.org Git - python/commitdiff
rewrite error handling to make sense
authorBenjamin Peterson <benjamin@python.org>
Thu, 2 Apr 2009 02:27:20 +0000 (02:27 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 2 Apr 2009 02:27:20 +0000 (02:27 +0000)
Python/symtable.c

index 92b223276fcc4b5cae5c476e975288a3a7f062b6..3c1735ca9942ffca13be958da1e911c62debbb72 100644 (file)
@@ -824,14 +824,18 @@ analyze_child_block(PySTEntryObject *entry, PyObject *bound, PyObject *free,
 
        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