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
........
This commit is contained in:
Benjamin Peterson 2009-12-13 00:59:01 +00:00
parent e2d6700d4a
commit 011e9f1726
3 changed files with 464 additions and 90 deletions

View file

@ -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;