summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Python/ast.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 66b85b5a7f..ef161b6f25 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;
}