Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
nbdsh: Fix behaviour of globals.
  • Loading branch information
rwmjones committed Sep 11, 2019
1 parent dcd8838 commit d6cbd13
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/nbdsh.py
Expand Up @@ -57,8 +57,10 @@ def shell():
if not args.command:
code.interact (banner = banner, local = locals(), exitmsg = '')
else:
# https://stackoverflow.com/a/11754346
d = dict (locals(), **globals())
for c in args.command:
if c != '-':
exec (c)
exec (c, d, d)
else:
exec (sys.stdin.read ())
exec (sys.stdin.read (), d, d)

0 comments on commit d6cbd13

Please sign in to comment.