From: Robert Jordens Date: Tue, 29 Jul 2014 15:24:24 +0000 (+0200) Subject: Issue #21591: add test for qualified exec in tuple form. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af09c774e57d9c9b265fad0c092b63852d06ed25;p=python Issue #21591: add test for qualified exec in tuple form. --- diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index ec2709dbd1..5f91d0d638 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -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, "", "exec") + def test_exec_with_general_mapping_for_locals(self): class M: diff --git a/Misc/ACKS b/Misc/ACKS index 7f105c70f6..3751fd7a19 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -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