Skip to content

Commit 4011d86

Browse files
isidenticalgvanrossum
authored andcommitted
bpo-23896: Add a grammar where exec isn't a stmt (#13272)
https://bugs.python.org/issue23896
1 parent c09a9f5 commit 4011d86

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/lib2to3/pygram.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@ def __init__(self, grammar):
3636
python_grammar_no_print_statement = python_grammar.copy()
3737
del python_grammar_no_print_statement.keywords["print"]
3838

39+
python_grammar_no_print_and_exec_statement = python_grammar_no_print_statement.copy()
40+
del python_grammar_no_print_and_exec_statement.keywords["exec"]
41+
3942
pattern_grammar = driver.load_packaged_grammar("lib2to3", _PATTERN_GRAMMAR_FILE)
4043
pattern_symbols = Symbols(pattern_grammar)

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,3 +1860,4 @@ Carsten Klein
18601860
Diego Rojas
18611861
Edison Abahurire
18621862
Geoff Shannon
1863+
Batuhan Taskaya
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Adds a grammar to lib2to3.pygram that contains exec as a function not as
2+
statement.

0 commit comments

Comments
 (0)