summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-01-16 22:31:43 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-01-16 22:31:43 (GMT)
commit205ad61313eef001d1e6d8afe338242dd1fac984 (patch)
tree7ff5f0bd84a6d8bbff949935f99124e529d970b4 /Python/ast.c
parentc0beabc2a57f6599a411d3b5579dd6c64ffd47b7 (diff)
downloadcpython-205ad61313eef001d1e6d8afe338242dd1fac984.zip
cpython-205ad61313eef001d1e6d8afe338242dd1fac984.tar.gz
cpython-205ad61313eef001d1e6d8afe338242dd1fac984.tar.bz2
only finish error if one occurred
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 66b85b5..ef161b6 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -835,7 +835,8 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
PyTuple_SET_ITEM(c.c_normalize_args, 1, NULL);
Py_DECREF(c.c_normalize_args);
}
- ast_error_finish(filename);
+ if (!res)
+ ast_error_finish(filename);
return res;
}