Skip to content

Commit fe9a868

Browse files
committed
commit test in test_grammar.py
1 parent bad4cda commit fe9a868

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_grammar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,9 @@ def foo(): print([x for x in [1, 2, 2]])
10701070
with warnings.catch_warnings(record=True) as w:
10711071
warnings.filterwarnings('always', category=Py3xWarning)
10721072
def foo(): x = 0; [x for x in [1, 2, 2]]; print(x)
1073+
with check_py3k_warnings(
1074+
("list comprehension rebinds name 'x'", Py3xWarning)):
1075+
exec "x = 'outer'; ys = [x for x in range(3)]\n" in {}
10731076
def foo(): x = 0; print(x); [x for x in [1, 2, 2]]
10741077
def foo():
10751078
x = 0

0 commit comments

Comments
 (0)