cpython: 4b4f142befea (original) (raw)
Mercurial > cpython
changeset 83074:4b4f142befea
#14254: merge with 3.3. [#14254]
Roger Serwy roger.serwy@gmail.com | |
---|---|
date | Wed, 03 Apr 2013 00:43:31 -0500 |
parents | 578edbe38f0a(current diff)0be85a7fc839(diff) |
children | 660d6a4bfce9 |
files | Lib/idlelib/PyShell.py Misc/NEWS |
diffstat | 2 files changed, 14 insertions(+), 2 deletions(-)[+] [-] Lib/idlelib/PyShell.py 14 Misc/NEWS 2 |
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -458,6 +458,7 @@ class ModifiedInterpreter(InteractiveInt self.display_no_subprocess_error() return None self.transfer_path(with_cwd=with_cwd)
console.stop_readline()[](#l1.7) # annotate restart in shell window and mark it[](#l1.8) console.text.delete("iomark", "end-1c")[](#l1.9) if was_executing:[](#l1.10)
@@ -896,6 +897,7 @@ class PyShell(OutputWindow): canceled = False endoffile = False closing = False
def set_warning_stream(self, stream): global warning_stream @@ -971,8 +973,7 @@ class PyShell(OutputWindow): parent=self.text) if response is False: return "cancel"
if self.reading:[](#l1.23)
self.top.quit()[](#l1.24)
self.stop_readline()[](#l1.25) self.canceled = True[](#l1.26) self.closing = True[](#l1.27) # Wait for poll_subprocess() rescheduling to stop[](#l1.28)
@@ -1030,6 +1031,12 @@ class PyShell(OutputWindow): tkinter._default_root = None # 03Jan04 KBK What's this? return True
- def stop_readline(self):
if not self.reading: # no nested mainloop to exit.[](#l1.34)
return[](#l1.35)
self._stop_readline_flag = True[](#l1.36)
self.top.quit()[](#l1.37)
+ def readline(self): save = self.reading try: @@ -1037,6 +1044,9 @@ class PyShell(OutputWindow): self.top.mainloop() # nested mainloop() finally: self.reading = save
if self._stop_readline_flag:[](#l1.46)
self._stop_readline_flag = False[](#l1.47)
return ""[](#l1.48) line = self.text.get("iomark", "end-1c")[](#l1.49) if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C[](#l1.50) line = "\n"[](#l1.51)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -302,6 +302,8 @@ Core and Builtins Library ------- +- Issue #14254: IDLE now handles readline correctly across shell restarts. +