Permalink
Browse files

removed dependency of PSL code module as it doesn't work quite right …

…with IPy
  • Loading branch information...
1 parent 0e68e83 commit 8e32f01e50e914cf3d658fe6bd84e817f1475d68 @devhawk committed Mar 27, 2009
Showing with 9 additions and 10 deletions.
  1. +9 −10 ipydbg.py
View
@@ -314,10 +314,7 @@ def _print_source_line(self, sp, lines):
@inputcmd(_inputcmds, ConsoleKey.R)
def _input_repl_cmd(self, keyinfo):
- # I'd really like to replace some of this code with code.interact, but
- # code.interact doesn't work currently because Ctl-Z doesn't throw an
- # EOFError in raw_input like CPy does
- from codeop import compile_command
+
print
repl_locals = {'self': self}
with CC.ConsoleColorMgr(ConsoleColor.DarkBlue, ConsoleColor.White):
@@ -331,13 +328,15 @@ def _input_repl_cmd(self, keyinfo):
break
try:
- cmd = cmd + line + "\n"
- code = compile_command(cmd)
- if code != None:
- exec code in globals(), repl_locals
- cmd = ""
+ if line:
+ cmd = cmd + line + "\n"
+ else:
+ code = compile(cmd, "<input>", "single")
+ if code != None:
+ exec code in globals(), repl_locals
+ cmd = ""
except Exception, ex:
- with CC.Red: print ex
+ with CC.Red: print type(ex), ex
cmd = ""
@inputcmd(_inputcmds, ConsoleKey.Spacebar)

0 comments on commit 8e32f01

Please sign in to comment.