Fix input() builtin function to respect compiler flags.

(SF patch 876178, patch by mwh, unittest by perky)
This commit is contained in:
Hye-Shik Chang 2004-02-02 13:39:01 +00:00
parent 96c44658b9
commit ff83c2bacc
3 changed files with 20 additions and 1 deletions

View file

@ -979,6 +979,7 @@ builtin_input(PyObject *self, PyObject *args)
char *str;
PyObject *res;
PyObject *globals, *locals;
PyCompilerFlags cf;
line = builtin_raw_input(self, args);
if (line == NULL)
@ -994,7 +995,9 @@ builtin_input(PyObject *self, PyObject *args)
PyEval_GetBuiltins()) != 0)
return NULL;
}
res = PyRun_String(str, Py_eval_input, globals, locals);
cf.cf_flags = 0;
PyEval_MergeCompilerFlags(&cf);
res = PyRun_StringFlags(str, Py_eval_input, globals, locals, &cf);
Py_DECREF(line);
return res;
}