diff -r 8e1caaf567c4 Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Wed May 08 00:44:15 2013 +0200 +++ b/Lib/idlelib/PyShell.py Fri May 17 23:23:04 2013 -0400 @@ -13,6 +13,7 @@ import traceback import types import io +import textwrap import linecache from code import InteractiveInterpreter @@ -806,6 +807,8 @@ class PyShell(OutputWindow): shell_title = "Python " + python_version() + " Shell" + shell_ps1 = '>>> ' + shell_ps2 = '... ' # not used yet # Override classes ColorDelegator = ModifiedColorDelegator @@ -934,7 +937,6 @@ RemoteDebugger.close_remote_debugger(self.interp.rpcclt) self.resetoutput() self.console.write("[DEBUG OFF]\n") - sys.ps1 = ">>> " self.showprompt() self.set_debugger_indicator() @@ -946,7 +948,7 @@ dbg_gui = Debugger.Debugger(self) self.interp.setdebugger(dbg_gui) dbg_gui.load_breakpoints() - sys.ps1 = "[DEBUG ON]\n>>> " + self.console.write("[DEBUG ON]\n") self.showprompt() self.set_debugger_indicator() @@ -1234,15 +1236,18 @@ def showprompt(self): self.resetoutput() - try: - s = str(sys.ps1) - except: - s = "" - self.console.write(s) + self.getprompt() self.text.mark_set("insert", "end-1c") self.set_line_and_column() self.io.reset_undo() + def getprompt(self): + self.interp.runcommand(textwrap.dedent("""\ + try: + print(sys.ps1, end="") + except: + print('>>> ',end="")""")) + def resetoutput(self): source = self.text.get("iomark", "end-1c") if self.history: