summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>2022-07-18 21:10:49 (GMT)
committerGitHub <noreply@github.com>2022-07-18 21:10:49 (GMT)
commit0daba822212cd5d6c63384a27f390f0945330c2b (patch)
tree8a03ae55dbe6da2d90189b8c6595c6324977cf25 /Parser
parent73eab9f35ca17c7c3b813c717673934b0ab8ed64 (diff)
downloadcpython-0daba822212cd5d6c63384a27f390f0945330c2b.zip
cpython-0daba822212cd5d6c63384a27f390f0945330c2b.tar.gz
cpython-0daba822212cd5d6c63384a27f390f0945330c2b.tar.bz2
gh-94949: Disallow parsing parenthesised ctx mgr with old feature_version (#94950)
* gh-94949: Disallow parsing parenthesised ctx manager with old feature_version * 📜🤖 Added by blurb_it. * Allow it with feature_version=(3, 9) as well Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Parser')
-rw-r--r--Parser/parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/parser.c b/Parser/parser.c
index 309c249..f4082ab 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -6515,7 +6515,7 @@ with_stmt_rule(Parser *p)
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
- _res = _PyAST_With ( a , b , NULL , EXTRA );
+ _res = CHECK_VERSION ( stmt_ty , 9 , "Parenthesized context managers are" , _PyAST_With ( a , b , NULL , EXTRA ) );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;