summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-12-13 01:23:39 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-12-13 01:23:39 (GMT)
commit97dd987ae2ed1b0e10697dd6b5ac31bab6d7bcba (patch)
tree30e10fb33cd09c430e3ce70725a2333c159fdbc7 /Python/bltinmodule.c
parentddf4b81ee79d8adc9b0e9de39d208d4548edf601 (diff)
downloadcpython-97dd987ae2ed1b0e10697dd6b5ac31bab6d7bcba.zip
cpython-97dd987ae2ed1b0e10697dd6b5ac31bab6d7bcba.tar.gz
cpython-97dd987ae2ed1b0e10697dd6b5ac31bab6d7bcba.tar.bz2
Merged revisions 76534,76538,76628,76701,76774 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76534 | martin.v.loewis | 2009-11-26 02:42:05 -0600 (Thu, 26 Nov 2009) | 2 lines Fix typo. ........ r76538 | georg.brandl | 2009-11-26 14:48:25 -0600 (Thu, 26 Nov 2009) | 1 line #7400: typo. ........ r76628 | andrew.kuchling | 2009-12-02 08:27:11 -0600 (Wed, 02 Dec 2009) | 1 line Markup fixes ........ r76701 | andrew.kuchling | 2009-12-07 20:37:05 -0600 (Mon, 07 Dec 2009) | 1 line Typo fix; grammar fix ........ 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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 297c795..5710c07 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -529,6 +529,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 *cmd;
static char *kwlist[] = {"source", "filename", "mode", "flags",
@@ -567,7 +568,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) {
PyObject *result;
if (supplied_flags & PyCF_ONLY_AST) {
Py_INCREF(cmd);