diff options
author | Guido van Rossum <guido@python.org> | 2020-06-20 17:10:25 -0700 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2020-06-20 17:13:00 -0700 |
commit | 4910cc0aee6cd2772bdbae05c725922e466e932e (patch) | |
tree | 5fa3b833e6bec13c538483a969ccc2ed779a05fa /Python/pythonrun.c | |
parent | ec4f68816ef2243e6de9760b823b0955701fd3ec (diff) | |
download | cpython-git-4910cc0aee6cd2772bdbae05c725922e466e932e.tar.gz |
Also check PyCF_ONLY_AST for old parser
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index cb0e3b02e1..70748dc584 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1402,7 +1402,7 @@ PyParser_ASTFromStringObject(const char *s, PyObject *filename, int start, PyCompilerFlags localflags = _PyCompilerFlags_INIT; perrdetail err; int iflags = PARSER_FLAGS(flags); - if (flags && flags->cf_feature_version < 7) + if (flags && (flags->cf_flags & PyCF_ONLY_AST) && flags->cf_feature_version < 7) iflags |= PyPARSE_ASYNC_HACKS; node *n = PyParser_ParseStringObject(s, filename, |