Browse files

reuse a single locals dictionary for the entire REPL session

  • Loading branch information...
1 parent 7516e69 commit f15cfb3fca5a50c803e56cf897cd8d4d27f2b18c @devhawk committed Mar 27, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 ipydbg.py
View
3 ipydbg.py
@@ -315,6 +315,7 @@ def _print_source_line(self, sp, lines):
@inputcmd(_inputcmds, ConsoleKey.R)
def _input_repl_cmd(self, keyinfo):
print
+ repl_locals = {'self': self}
with CC.ConsoleColorMgr(ConsoleColor.DarkBlue, ConsoleColor.White):
print "REPL Console"
cmd = ""
@@ -327,7 +328,7 @@ def _input_repl_cmd(self, keyinfo):
else:
code = compile(cmd, "<input>", "single")
print "Executing:"+ cmd
- exec code in globals(), {'self': self}
+ exec code in globals(), repl_locals
cmd = ""
else:
cmd = cmd + line

0 comments on commit f15cfb3

Please sign in to comment.