mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix input() builtin function to respect compiler flags.
(SF patch 876178, patch by mwh, unittest by perky)
This commit is contained in:
parent
96c44658b9
commit
ff83c2bacc
3 changed files with 20 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue