only finish error if one occurred

This commit is contained in:
Benjamin Peterson 2012-01-16 17:31:43 -05:00
parent c0beabc2a5
commit 205ad61313
1 changed files with 2 additions and 1 deletions

View 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;
}