mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25: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
|
@ -777,7 +777,8 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags,
|
|||
/* borrowed reference */
|
||||
c.c_filename = filename;
|
||||
c.c_normalize = NULL;
|
||||
c.c_feature_version = flags ? flags->cf_feature_version : PY_MINOR_VERSION;
|
||||
c.c_feature_version = flags && (flags->cf_flags & PyCF_ONLY_AST) ?
|
||||
flags->cf_feature_version : PY_MINOR_VERSION;
|
||||
|
||||
if (TYPE(n) == encoding_decl)
|
||||
n = CHILD(n, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue