From 5f429e02274f85f4ba19276847e323b13fae6568 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 13 Dec 2009 00:54:15 +0000 Subject: account for PyObject_IsInstance's new ability to fail --- Python/bltinmodule.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Python/bltinmodule.c') 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; -- cgit v1.2.1