diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-12-13 00:54:15 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-12-13 00:54:15 +0000 |
commit | 5f429e02274f85f4ba19276847e323b13fae6568 (patch) | |
tree | 176e42c26c0b0ac59301f85e25b4819cffc7a0e3 /Python/bltinmodule.c | |
parent | c169c781a807e0d0e1463d510be9523b1d6c2689 (diff) | |
download | cpython-git-5f429e02274f85f4ba19276847e323b13fae6568.tar.gz |
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 b201aaf787..3132cf4b41 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -466,6 +466,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; @@ -505,7 +506,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; |