diff options
| author | Kurt B. Kaiser <kbk@shore.net> | 2003-06-05 02:38:32 +0000 |
|---|---|---|
| committer | Kurt B. Kaiser <kbk@shore.net> | 2003-06-05 02:38:32 +0000 |
| commit | 3126d3b2877f9b8bd2d3abbcf163c69a4ae3e4ff (patch) | |
| tree | 6d58cb276e5162921c08ce410771aa7c7a2daebc /Lib/idlelib/ScriptBinding.py | |
| parent | 09cc9c72e496180219f297cd842cbf30b8106433 (diff) | |
| download | cpython-3126d3b2877f9b8bd2d3abbcf163c69a4ae3e4ff.tar.gz | |
SF 747667 Error Doesn't Decolorize
Also improved error notification if Tabnanny detects a TokenError.
M ScriptBinding
Diffstat (limited to 'Lib/idlelib/ScriptBinding.py')
| -rw-r--r-- | Lib/idlelib/ScriptBinding.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py index 0e0f1ffd7a..fa9ecbc523 100644 --- a/Lib/idlelib/ScriptBinding.py +++ b/Lib/idlelib/ScriptBinding.py @@ -69,7 +69,10 @@ class ScriptBinding: try: tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError, msg: - self.errorbox("Token error", "Token error:\n%s" % msg) + msgtxt, (lineno, start) = msg + self.editwin.gotoline(lineno) + self.errorbox("Tabnanny Tokenizing Error", + "Token Error: %s" % msgtxt) return False except tabnanny.NannyNag, nag: # The error messages from tabnanny are too confusing... @@ -86,6 +89,8 @@ class ScriptBinding: source = re.sub(r"\r\n", "\n", source) 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 return compile(source, filename, "exec") |
