[Idle-dev] CVS: idle PyShell.py,1.33,1.34 rpc.py,1.8,1.9

Kurt B. Kaiser kbk@users.sourceforge.net
Fri, 29 Nov 2002 22:18:02 -0800


Update of /cvsroot/idlefork/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv24525

Modified Files:
	PyShell.py rpc.py 
Log Message:
M PyShell.py
M rpc.py

SF Bug 629987: Idle not printing prompts following SyntaxError


Index: PyShell.py
===================================================================
RCS file: /cvsroot/idlefork/idle/PyShell.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** PyShell.py	29 Nov 2002 22:10:53 -0000	1.33
--- PyShell.py	30 Nov 2002 06:17:59 -0000	1.34
***************
*** 2,5 ****
--- 2,6 ----
  
  import os
+ import os.path
  import sys
  import string
***************
*** 25,29 ****
  from configHandler import idleConf
  import idlever
- import os.path
  
  import rpc
--- 26,29 ----
***************
*** 418,421 ****
--- 418,422 ----
              self.tkconsole.resetoutput()
              InteractiveInterpreter.showsyntaxerror(self, filename)
+             self.tkconsole.showprompt()
          else:
              self.runcode(code)
***************
*** 459,479 ****
          text = self.tkconsole.text
          stuff = self.unpackerror()
!         if not stuff:
              self.tkconsole.resetoutput()
!             InteractiveInterpreter.showsyntaxerror(self, filename)
!             return
!         msg, lineno, offset, line = stuff
!         if lineno == 1:
!             pos = "iomark + %d chars" % (offset-1)
          else:
!             pos = "iomark linestart + %d lines + %d chars" % (lineno-1,
!                                                               offset-1)
!         text.tag_add("ERROR", pos)
!         text.see(pos)
!         char = text.get(pos)
!         if char and char in IDENTCHARS:
!             text.tag_add("ERROR", pos + " wordstart", pos)
!         self.tkconsole.resetoutput()
!         self.write("SyntaxError: %s\n" % str(msg))
  
      def unpackerror(self):
--- 460,481 ----
          text = self.tkconsole.text
          stuff = self.unpackerror()
!         if stuff:
!             msg, lineno, offset, line = stuff
!             if lineno == 1:
!                 pos = "iomark + %d chars" % (offset-1)
!             else:
!                 pos = "iomark linestart + %d lines + %d chars" % \
!                       (lineno-1, offset-1)
!             text.tag_add("ERROR", pos)
!             text.see(pos)
!             char = text.get(pos)
!             if char and char in IDENTCHARS:
!                 text.tag_add("ERROR", pos + " wordstart", pos)
              self.tkconsole.resetoutput()
!             self.write("SyntaxError: %s\n" % str(msg))
          else:
!             self.tkconsole.resetoutput()
!             InteractiveInterpreter.showsyntaxerror(self, filename)
!         self.tkconsole.showprompt()
  
      def unpackerror(self):

Index: rpc.py
===================================================================
RCS file: /cvsroot/idlefork/idle/rpc.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** rpc.py	10 Oct 2002 08:25:24 -0000	1.8
--- rpc.py	30 Nov 2002 06:18:00 -0000	1.9
***************
*** 91,95 ****
  class SocketIO:
  
!     debugging = 0
  
      def __init__(self, sock, objtable=None, debugging=None):
--- 91,95 ----
  class SocketIO:
  
!     debugging = False
  
      def __init__(self, sock, objtable=None, debugging=None):
***************
*** 190,193 ****
--- 190,194 ----
      def asyncreturn(self, seq):
          response = self.getresponse(seq)
+         self.debug("asyncreturn:", response)
          return self.decoderesponse(response)