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/ast.c | |
parent | ec4f68816ef2243e6de9760b823b0955701fd3ec (diff) | |
download | cpython-git-4910cc0aee6cd2772bdbae05c725922e466e932e.tar.gz |
Also check PyCF_ONLY_AST for old parser
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c index 408591f325..86f0260a81 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -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); |