]> granicus.if.org Git - python/commitdiff
Use Queue's blocking feature instead of sleeping in the main
authorKurt B. Kaiser <kbk@shore.net>
Thu, 5 May 2005 23:29:54 +0000 (23:29 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Thu, 5 May 2005 23:29:54 +0000 (23:29 +0000)
loop.  Patch # 1190163 Michiel de Hoon

Lib/idlelib/NEWS.txt
Lib/idlelib/run.py

index 06702559ac2e2620c643d2b3ca1c70b8db7d0080..afec8e422f30ecea84d20debda912353f158b538 100644 (file)
@@ -3,6 +3,9 @@ What's New in IDLE 1.2a0?
 
 *Release date: XX-XXX-2005*
 
+- run.py: use Queue's blocking feature instead of sleeping in the main
+  loop.  Patch # 1190163 Michiel de Hoon
+
 - Add config-main option to make the 'history' feature non-cyclic.
   Default remains cyclic.  Python Patch 914546 Noam Raphael.
 
index 62f4ccea29262d6088bfd5b7f88ec6ca2264a254..8adb6f1e76d6f9b77ff4805a077b6023c6e51882 100644 (file)
@@ -82,9 +82,8 @@ def main(del_exitfunc=False):
                     # exiting but got an extra KBI? Try again!
                     continue
             try:
-                seq, request = rpc.request_queue.get(0)
+                seq, request = rpc.request_queue.get(block=True, timeout=0.05)
             except Queue.Empty:
-                time.sleep(0.05)
                 continue
             method, args, kwargs = request
             ret = method(*args, **kwargs)