Skip to content

Commit 4ae3eab

Browse files
committed
Fix local exec
Execute as module, with globals (which are also locals) https://docs.python.org/3/library/functions.html#exec
1 parent 811a28a commit 4ae3eab

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pythonwhat/local.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from contextlib import redirect_stdout
88

99
class StubShell(object):
10-
10+
1111
def __init__(self, init_code = None):
1212
self.user_ns = {}
1313
if init_code:
1414
self.run_code(init_code)
15-
15+
1616
def run_code(self, code):
17-
exec(code, None, self.user_ns)
17+
exec(code, self.user_ns)
1818

1919
class StubProcess(object):
2020

0 commit comments

Comments
 (0)