diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-12-13 00:59:01 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-12-13 00:59:01 +0000 |
commit | 011e9f172654618f39a735bd549245cad876ce38 (patch) | |
tree | 4f725ea13698c6597ee86f60b0d9b4df34638412 /Python/bltinmodule.c | |
parent | e2d6700d4af020d29846a225219b6847d15719fb (diff) | |
download | cpython-git-011e9f172654618f39a735bd549245cad876ce38.tar.gz |
Merged revisions 76774 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76774 | benjamin.peterson | 2009-12-12 18:54:15 -0600 (Sat, 12 Dec 2009) | 1 line
account for PyObject_IsInstance's new ability to fail
........
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 1cab40c049..4b5a062f6f 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -465,6 +465,7 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds) int mode = -1; int dont_inherit = 0; int supplied_flags = 0; + int is_ast; PyCompilerFlags cf; PyObject *result = NULL, *cmd, *tmp = NULL; Py_ssize_t length; @@ -504,7 +505,10 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds) return NULL; } - if (PyAST_Check(cmd)) { + is_ast = PyAST_Check(cmd); + if (is_ast == -1) + return NULL; + if (is_ast) { if (supplied_flags & PyCF_ONLY_AST) { Py_INCREF(cmd); result = cmd; |