]> granicus.if.org Git - python/commitdiff
bpo-23896: Add a grammar where exec isn't a stmt (#13272)
authorBatuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
Mon, 20 May 2019 20:27:10 +0000 (23:27 +0300)
committerGuido van Rossum <guido@python.org>
Mon, 20 May 2019 20:27:10 +0000 (13:27 -0700)
https://bugs.python.org/issue23896

Lib/lib2to3/pygram.py
Misc/ACKS
Misc/NEWS.d/next/Library/2019-05-13-05-49-15.bpo-23896.8TtUKo.rst [new file with mode: 0644]

index 919624eb3997069adcce385315322d67e2844061..24d9db9217f131adf50f6eca7d571ce69cbcbc3e 100644 (file)
@@ -36,5 +36,8 @@ python_symbols = Symbols(python_grammar)
 python_grammar_no_print_statement = python_grammar.copy()
 del python_grammar_no_print_statement.keywords["print"]
 
+python_grammar_no_print_and_exec_statement = python_grammar_no_print_statement.copy()
+del python_grammar_no_print_and_exec_statement.keywords["exec"]
+
 pattern_grammar = driver.load_packaged_grammar("lib2to3", _PATTERN_GRAMMAR_FILE)
 pattern_symbols = Symbols(pattern_grammar)
index f9d01d008679990e20bfdc8bfb53c6f6c3f24976..87107b9cfc7d2bd7bc4b073db5be75c5dec42ff1 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1860,3 +1860,4 @@ Carsten Klein
 Diego Rojas
 Edison Abahurire
 Geoff Shannon
+Batuhan Taskaya
diff --git a/Misc/NEWS.d/next/Library/2019-05-13-05-49-15.bpo-23896.8TtUKo.rst b/Misc/NEWS.d/next/Library/2019-05-13-05-49-15.bpo-23896.8TtUKo.rst
new file mode 100644 (file)
index 0000000..3c15482
--- /dev/null
@@ -0,0 +1,2 @@
+Adds a grammar to lib2to3.pygram that contains exec as a function not as
+statement.