summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2020-06-20 17:10:25 -0700
committerGuido van Rossum <guido@python.org>2020-06-20 17:20:03 -0700
commit05e8a550e14912fe2152862d97876f362c6b1bb9 (patch)
tree4597ccdcd730a3455404ea38047ad1010b2ba400 /Python/ast.c
parenta4c09560eaa1e3b9733c7e63d570b6fa7626724c (diff)
downloadcpython-git-05e8a550e14912fe2152862d97876f362c6b1bb9.tar.gz
[3.8] bpo-35975: Only use cf_feature_version if PyCF_ONLY_AST in cf_flags
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 0a999fcca4..52ff0a3a53 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -808,7 +808,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);