]> granicus.if.org Git - python/commitdiff
only finish error if one occurred
authorBenjamin Peterson <benjamin@python.org>
Mon, 16 Jan 2012 22:31:43 +0000 (17:31 -0500)
committerBenjamin Peterson <benjamin@python.org>
Mon, 16 Jan 2012 22:31:43 +0000 (17:31 -0500)
Python/ast.c

index 66b85b5a7f532292e54af2b44a31fbc9ac3c64b7..ef161b6f258be54321f5c7e76729e928c7370966 100644 (file)
@@ -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;
 }