mirror of
https://github.com/python/cpython.git
synced 2025-07-13 22:35:18 +00:00
[3.9] bpo-35975: Only use cf_feature_version if PyCF_ONLY_AST in cf_flags (#21022)
This commit is contained in:
parent
dab533d0ee
commit
2a1ee1d970
6 changed files with 33 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue