Mercurial > cpython-lru_cache-weakref
diff Lib/idlelib/PyShell.py @ 26468:fbb24cd54766 legacy-trunk
M PyShell.py
M rpc.py
SF Bug 629987: Idle not printing prompts following SyntaxError
| author | Kurt B. Kaiser <kbk@shore.net> |
|---|---|
| date | Sat, 30 Nov 2002 06:18:00 +0000 |
| parents | c88f6fff1c3f |
| children | 99c78cf95610 |
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py Sat Nov 30 03:53:15 2002 +0000 +++ b/Lib/idlelib/PyShell.py Sat Nov 30 06:18:00 2002 +0000 @@ -1,6 +1,7 @@ #! /usr/bin/env python import os +import os.path import sys import string import getopt @@ -24,7 +25,6 @@ from OutputWindow import OutputWindow from configHandler import idleConf import idlever -import os.path import rpc import RemoteDebugger @@ -417,6 +417,7 @@ except (OverflowError, SyntaxError): self.tkconsole.resetoutput() InteractiveInterpreter.showsyntaxerror(self, filename) + self.tkconsole.showprompt() else: self.runcode(code) @@ -458,23 +459,24 @@ """ 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() + self.write("SyntaxError: %s\n" % str(msg)) + else: 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)) + self.tkconsole.showprompt() def unpackerror(self): type, value, tb = sys.exc_info()
