diff Python/bltinmodule.c @ 57673:20b7deb53d4e legacy-trunk

account for PyObject_IsInstance's new ability to fail
author Benjamin Peterson <benjamin@python.org>
date Sun, 13 Dec 2009 00:54:15 +0000
parents 75e1b8c05f43
children f550ed89398f
line wrap: on
line diff
--- a/Python/bltinmodule.c	Sat Dec 12 19:13:08 2009 +0000
+++ b/Python/bltinmodule.c	Sun Dec 13 00:54:15 2009 +0000
@@ -466,6 +466,7 @@
 	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 @@
 		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;