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

Skip to content

Commit 20345fb

Browse files
committed
Use Queue's blocking feature instead of sleeping in the main
loop. Patch # 1190163 Michiel de Hoon
1 parent abb103b commit 20345fb

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/idlelib/NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ What's New in IDLE 1.2a0?
33

44
*Release date: XX-XXX-2005*
55

6+
- run.py: use Queue's blocking feature instead of sleeping in the main
7+
loop. Patch # 1190163 Michiel de Hoon
8+
69
- Add config-main option to make the 'history' feature non-cyclic.
710
Default remains cyclic. Python Patch 914546 Noam Raphael.
811

Lib/idlelib/run.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ def main(del_exitfunc=False):
8282
# exiting but got an extra KBI? Try again!
8383
continue
8484
try:
85-
seq, request = rpc.request_queue.get(0)
85+
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
8686
except Queue.Empty:
87-
time.sleep(0.05)
8887
continue
8988
method, args, kwargs = request
9089
ret = method(*args, **kwargs)

0 commit comments

Comments
 (0)