summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/run.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 6440e67..176fe3d 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -134,13 +134,17 @@ def main(del_exitfunc=False):
# exiting but got an extra KBI? Try again!
continue
try:
- seq, request = rpc.request_queue.get(block=True, timeout=0.05)
+ request = rpc.request_queue.get(block=True, timeout=0.05)
except queue.Empty:
+ request = None
+ # Issue 32207: calling handle_tk_events here adds spurious
+ # queue.Empty traceback to event handling exceptions.
+ if request:
+ seq, (method, args, kwargs) = request
+ ret = method(*args, **kwargs)
+ rpc.response_queue.put((seq, ret))
+ else:
handle_tk_events()
- continue
- method, args, kwargs = request
- ret = method(*args, **kwargs)
- rpc.response_queue.put((seq, ret))
except KeyboardInterrupt:
if quitting:
exit_now = True