diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2002-11-30 06:18:00 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2002-11-30 06:18:00 (GMT) |
commit | 6e44cc236900c8f85164e543d0d3e7f429a1f1c8 (patch) | |
tree | 0956752ca71c0e4515c197bcfb6c0b52549a7406 /Lib/idlelib | |
parent | a59ef7bbe025b05f5db0973ebdf8d973bf639e26 (diff) | |
download | cpython-6e44cc236900c8f85164e543d0d3e7f429a1f1c8.zip cpython-6e44cc236900c8f85164e543d0d3e7f429a1f1c8.tar.gz cpython-6e44cc236900c8f85164e543d0d3e7f429a1f1c8.tar.bz2 |
M PyShell.py
M rpc.py
SF Bug 629987: Idle not printing prompts following SyntaxError
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/PyShell.py | 34 | ||||
-rw-r--r-- | Lib/idlelib/rpc.py | 3 |
2 files changed, 20 insertions, 17 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index ad8263d..3fc814b 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1,6 +1,7 @@ #! /usr/bin/env python import os +import os.path import sys import string import getopt @@ -24,7 +25,6 @@ from UndoDelegator import UndoDelegator from OutputWindow import OutputWindow from configHandler import idleConf import idlever -import os.path import rpc import RemoteDebugger @@ -417,6 +417,7 @@ class ModifiedInterpreter(InteractiveInterpreter): except (OverflowError, SyntaxError): self.tkconsole.resetoutput() InteractiveInterpreter.showsyntaxerror(self, filename) + self.tkconsole.showprompt() else: self.runcode(code) @@ -458,23 +459,24 @@ class ModifiedInterpreter(InteractiveInterpreter): """ text = self.tkconsole.text stuff = self.unpackerror() - if not stuff: + 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() - InteractiveInterpreter.showsyntaxerror(self, filename) - return - msg, lineno, offset, line = stuff - if lineno == 1: - pos = "iomark + %d chars" % (offset-1) + self.write("SyntaxError: %s\n" % str(msg)) 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)) + self.tkconsole.resetoutput() + InteractiveInterpreter.showsyntaxerror(self, filename) + self.tkconsole.showprompt() def unpackerror(self): type, value, tb = sys.exc_info() diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index eeb1b4e..4bbf0bb 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -90,7 +90,7 @@ objecttable = {} class SocketIO: - debugging = 0 + debugging = False def __init__(self, sock, objtable=None, debugging=None): self.mainthread = threading.currentThread() @@ -189,6 +189,7 @@ class SocketIO: def asyncreturn(self, seq): response = self.getresponse(seq) + self.debug("asyncreturn:", response) return self.decoderesponse(response) def decoderesponse(self, response): |