comparison Python/bltinmodule.c @ 57675:087fe5fa113c

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 ........
author Benjamin Peterson <benjamin@python.org>
date Sun, 13 Dec 2009 01:23:39 +0000
parents 7dc57b991d83
children a08840ce88d3
comparison
equal deleted inserted replaced
57672:8048569eb53f 57675:087fe5fa113c
527 char *filename; 527 char *filename;
528 char *startstr; 528 char *startstr;
529 int mode = -1; 529 int mode = -1;
530 int dont_inherit = 0; 530 int dont_inherit = 0;
531 int supplied_flags = 0; 531 int supplied_flags = 0;
532 int is_ast;
532 PyCompilerFlags cf; 533 PyCompilerFlags cf;
533 PyObject *cmd; 534 PyObject *cmd;
534 static char *kwlist[] = {"source", "filename", "mode", "flags", 535 static char *kwlist[] = {"source", "filename", "mode", "flags",
535 "dont_inherit", NULL}; 536 "dont_inherit", NULL};
536 int start[] = {Py_file_input, Py_eval_input, Py_single_input}; 537 int start[] = {Py_file_input, Py_eval_input, Py_single_input};
565 PyErr_SetString(PyExc_ValueError, 566 PyErr_SetString(PyExc_ValueError,
566 "compile() arg 3 must be 'exec', 'eval' or 'single'"); 567 "compile() arg 3 must be 'exec', 'eval' or 'single'");
567 return NULL; 568 return NULL;
568 } 569 }
569 570
570 if (PyAST_Check(cmd)) { 571 is_ast = PyAST_Check(cmd);
572 if (is_ast == -1)
573 return NULL;
574 if (is_ast) {
571 PyObject *result; 575 PyObject *result;
572 if (supplied_flags & PyCF_ONLY_AST) { 576 if (supplied_flags & PyCF_ONLY_AST) {
573 Py_INCREF(cmd); 577 Py_INCREF(cmd);
574 result = cmd; 578 result = cmd;
575 } 579 }