Commit af09c774 authored by Robert Jordens's avatar Robert Jordens

Issue #21591: add test for qualified exec in tuple form.

parent 9b1d6703
......@@ -90,6 +90,22 @@ class TestSpecifics(unittest.TestCase):
with self.assertRaises(TypeError):
exec("a = b + 1", g, l) in g, l
def test_nested_qualified_exec(self):
# Can use qualified exec in nested functions.
code = ["""
def g():
def f():
if True:
exec "" in {}, {}
""", """
def g():
def f():
if True:
exec("", {}, {})
"""]
for c in code:
compile(c, "<code>", "exec")
def test_exec_with_general_mapping_for_locals(self):
class M:
......
......@@ -648,6 +648,7 @@ Richard Jones
Irmen de Jong
Lucas de Jonge
Kristján Valur Jónsson
Robert Jordens
Jens B. Jorgensen
John Jorgensen
Sijin Joseph
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment