[Idle-dev] CVS: idle ScriptBinding.py,1.24,1.25

Kurt B. Kaiser kbk@users.sourceforge.net
Wed, 04 Jun 2003 19:38:35 -0700


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

Modified Files:
	ScriptBinding.py 
Log Message:
SF 747667 Error Doesn't Decolorize

Also improved error notification if Tabnanny detects a TokenError.

M ScriptBinding


Index: ScriptBinding.py
===================================================================
RCS file: /cvsroot/idlefork/idle/ScriptBinding.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** ScriptBinding.py	31 May 2003 23:44:18 -0000	1.24
--- ScriptBinding.py	5 Jun 2003 02:38:32 -0000	1.25
***************
*** 70,74 ****
              tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
          except tokenize.TokenError, msg:
!             self.errorbox("Token error", "Token error:\n%s" % msg)
              return False
          except tabnanny.NannyNag, nag:
--- 70,77 ----
              tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
          except tokenize.TokenError, msg:
!             msgtxt, (lineno, start) = msg
!             self.editwin.gotoline(lineno)
!             self.errorbox("Tabnanny Tokenizing Error",
!                           "Token Error: %s" % msgtxt)
              return False
          except tabnanny.NannyNag, nag:
***************
*** 87,90 ****
--- 90,95 ----
          if source and source[-1] != '\n':
              source = source + '\n'
+         text = self.editwin.text
+         text.tag_remove("ERROR", "1.0", "end")
          try:
              # If successful, return the compiled code