Skip to content

Commit d6cd617

Browse files
committed
fixup! Add builtin_globals.
1 parent 5370c97 commit d6cd617

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/snippets/test_exec.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ def f():
3535
pass
3636
else:
3737
raise TypeError("exec should fail unless globals is a dict or None")
38+
39+
g = globals()
40+
g['x'] = 2
41+
exec('x += 2')
42+
assert x == 4
43+
assert g['x'] == x
44+
45+
exec("del x")
46+
assert 'x' not in g

0 commit comments

Comments
 (0)