[Python-checkins] bpo-23896: Add a grammar where exec isn't a stmt (#13272)

Guido van Rossum webhook-mailer at python.org
Mon May 20 16:27:14 EDT 2019


https://github.com/python/cpython/commit/4011d865d0572a3dd9988f2935cd835cc8fb792a
commit: 4011d865d0572a3dd9988f2935cd835cc8fb792a
branch: master
author: Batuhan Taşkaya <47358913+isidentical at users.noreply.github.com>
committer: Guido van Rossum <guido at python.org>
date: 2019-05-20T13:27:10-07:00
summary:

bpo-23896: Add a grammar where exec isn't a stmt (#13272)

https://bugs.python.org/issue23896

files:
A Misc/NEWS.d/next/Library/2019-05-13-05-49-15.bpo-23896.8TtUKo.rst
M Lib/lib2to3/pygram.py
M Misc/ACKS

diff --git a/Lib/lib2to3/pygram.py b/Lib/lib2to3/pygram.py
index 919624eb3997..24d9db9217f1 100644
--- a/Lib/lib2to3/pygram.py
+++ b/Lib/lib2to3/pygram.py
@@ -36,5 +36,8 @@ def __init__(self, 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)
diff --git a/Misc/ACKS b/Misc/ACKS
index f9d01d008679..87107b9cfc7d 100644
--- 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
index 000000000000..3c154822c9ac
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-05-13-05-49-15.bpo-23896.8TtUKo.rst
@@ -0,0 +1,2 @@
+Adds a grammar to lib2to3.pygram that contains exec as a function not as
+statement.



More information about the Python-checkins mailing list