summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-02 02:27:20 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-02 02:27:20 (GMT)
commitd1e5493a26a310a25722af3ad342212d2677672c (patch)
tree50bf54bf4b65138be997b2ba4b193fd9efd0e83a /Python/symtable.c
parent22081a1364f1f6e56327b6d0b167d84684c479e1 (diff)
downloadcpython-d1e5493a26a310a25722af3ad342212d2677672c.zip
cpython-d1e5493a26a310a25722af3ad342212d2677672c.tar.gz
cpython-d1e5493a26a310a25722af3ad342212d2677672c.tar.bz2
rewrite error handling to make sense
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 92b2232..3c1735c 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -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