summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 1d20deb..fbc3b16 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1005,7 +1005,10 @@ PyObject *
PyRun_StringFlags(char *str, int start, PyObject *globals, PyObject *locals,
PyCompilerFlags *flags)
{
- return run_err_node(PyParser_SimpleParseString(str, start),
+ return run_err_node(PyParser_SimpleParseStringFlags(
+ str, start,
+ (flags && flags->cf_flags & PyCF_GENERATORS) ?
+ PyPARSE_YIELD_IS_KEYWORD : 0),
"<string>", globals, locals, flags);
}