Kaydet (Commit) d2186e56 authored tarafından Kurt B. Kaiser's avatar Kurt B. Kaiser

The GUI was hanging if the shell window was closed while a raw_input()

was pending.  Restored the quit() of the readline() mainloop().
http://mail.python.org/pipermail/idle-dev/2004-December/002307.html

M NEWS.txt
M PyShell.py
üst 64d77717
What's New in IDLE 1.0.4? What's New in IDLE 1.0.4?
========================= =========================
*Release date: XX-XXX-2004* *Release date: XX-Dec-2004*
- The GUI was hanging if the shell window was closed while a raw_input()
was pending. Restored the quit() of the readline() mainloop().
http://mail.python.org/pipermail/idle-dev/2004-December/002307.html
- Added a Tk error dialog to run.py inform the user if the subprocess can't - Added a Tk error dialog to run.py inform the user if the subprocess can't
connect to the user GUI process. Added a timeout to the GUI's listening connect to the user GUI process. Added a timeout to the GUI's listening
......
...@@ -877,6 +877,9 @@ class PyShell(OutputWindow): ...@@ -877,6 +877,9 @@ class PyShell(OutputWindow):
parent=self.text) parent=self.text)
if response == False: if response == False:
return "cancel" return "cancel"
if self.reading:
self.top.quit()
self.canceled = True
self.closing = True self.closing = True
# Wait for poll_subprocess() rescheduling to stop # Wait for poll_subprocess() rescheduling to stop
self.text.after(2 * self.pollinterval, self.close2) self.text.after(2 * self.pollinterval, self.close2)
...@@ -941,10 +944,12 @@ class PyShell(OutputWindow): ...@@ -941,10 +944,12 @@ class PyShell(OutputWindow):
save = self.reading save = self.reading
try: try:
self.reading = 1 self.reading = 1
self.top.mainloop() self.top.mainloop() # nested mainloop()
finally: finally:
self.reading = save self.reading = save
line = self.text.get("iomark", "end-1c") line = self.text.get("iomark", "end-1c")
if len(line) == 0: # may be EOF if we quit our mainloop with Ctrl-C
line = "\n"
if isinstance(line, unicode): if isinstance(line, unicode):
import IOBinding import IOBinding
try: try:
...@@ -954,10 +959,11 @@ class PyShell(OutputWindow): ...@@ -954,10 +959,11 @@ class PyShell(OutputWindow):
self.resetoutput() self.resetoutput()
if self.canceled: if self.canceled:
self.canceled = 0 self.canceled = 0
raise KeyboardInterrupt if not use_subprocess:
raise KeyboardInterrupt
if self.endoffile: if self.endoffile:
self.endoffile = 0 self.endoffile = 0
return "" line = ""
return line return line
def isatty(self): def isatty(self):
...@@ -976,13 +982,13 @@ class PyShell(OutputWindow): ...@@ -976,13 +982,13 @@ class PyShell(OutputWindow):
return "break" return "break"
self.endoffile = 0 self.endoffile = 0
self.canceled = 1 self.canceled = 1
if self.reading: if (self.executing and self.interp.rpcclt):
self.top.quit()
elif (self.executing and self.interp.rpcclt):
if self.interp.getdebugger(): if self.interp.getdebugger():
self.interp.restart_subprocess() self.interp.restart_subprocess()
else: else:
self.interp.interrupt_subprocess() self.interp.interrupt_subprocess()
if self.reading:
self.top.quit() # exit the nested mainloop() in readline()
return "break" return "break"
def eof_callback(self, event): def eof_callback(self, event):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment