Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94afd30

Browse files
committed
Move setting of ioready 'wait' earlier in call chain, to
rpc.SocketIO.main() and asyncreturn(). Improve comment.
1 parent b1fbf85 commit 94afd30

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

Lib/idlelib/NEWS.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,27 @@ What's New in IDLEfork 0.9 Alpha 3?
77

88
*Release date: xx-xxx-2003*
99

10+
- Implemented the 'interrupt' extension module, which allows a subthread
11+
to raise a KeyboardInterrupt in the main thread.
12+
13+
- Attempting to save the shell raised an error related to saving
14+
breakpoints, which are not implemented in the shell
15+
16+
- Provide a correct message when 'exit' or 'quit' are entered at the
17+
IDLE command prompt SF 695861
18+
19+
- Eliminate extra blank line in shell output caused by not flushing
20+
stdout when user code ends with an unterminated print. SF 695861
21+
22+
- Moved responsibility for exception formatting (i.e. pruning IDLE internal
23+
calls) out of rpc.py into the client and server.
24+
1025
- Exit IDLE cleanly even when doing subprocess I/O
1126

1227
- Handle subprocess interrupt in Windows with an RPC message.
1328

1429
- Calling Run will restart the subprocess even if user code is running.
30+
SF RFE 661321
1531

1632
- Restart the subprocess if it terminates itself. (VPython programs do that)
1733

Lib/idlelib/rpc.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def asynccall(self, oid, methodname, args, kwargs):
192192

193193
def asyncreturn(self, seq):
194194
self.debug("asyncreturn:%d:call getresponse(): " % seq)
195-
response = self.getresponse(seq)
195+
response = self.getresponse(seq, wait=None)
196196
self.debug(("asyncreturn:%d:response: " % seq), response)
197197
return self.decoderesponse(response)
198198

@@ -211,17 +211,17 @@ def decoderesponse(self, response):
211211
def mainloop(self):
212212
"""Listen on socket until I/O not ready or EOF
213213
214-
pollpacket() will loop looking for seq number None, which never
215-
comes. The loop will exit when self.ioready() returns 0.
214+
Main thread pollresponse() will loop looking for seq number None, which
215+
never comes, and exit on EOFError.
216216
217217
"""
218218
try:
219-
self.getresponse(None)
219+
self.getresponse(myseq=None, wait=None)
220220
except EOFError:
221221
pass
222222

223-
def getresponse(self, myseq):
224-
response = self._getresponse(myseq)
223+
def getresponse(self, myseq, wait):
224+
response = self._getresponse(myseq, wait)
225225
if response is not None:
226226
how, what = response
227227
if how == "OK":
@@ -236,13 +236,13 @@ def _proxify(self, obj):
236236
# XXX Check for other types -- not currently needed
237237
return obj
238238

239-
def _getresponse(self, myseq):
239+
def _getresponse(self, myseq, wait):
240240
self.debug("_getresponse:myseq:", myseq)
241241
if threading.currentThread() is self.mainthread:
242242
# Main thread: does all reading of requests or responses
243243
# Loop here, blocking each time until socket is ready.
244244
while 1:
245-
response = self.pollresponse(myseq, wait=None)
245+
response = self.pollresponse(myseq, wait)
246246
if response is not None:
247247
return response
248248
else:

0 commit comments

Comments
 (0)