Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/idlelib/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def main(del_exitfunc=False):
).start()

while True:
request = None
try:
if exit_now:
try:
Expand All @@ -174,9 +175,9 @@ def main(del_exitfunc=False):
try:
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.
pass
if request:
seq, (method, args, kwargs) = request
ret = method(*args, **kwargs)
Expand All @@ -186,6 +187,10 @@ def main(del_exitfunc=False):
except KeyboardInterrupt:
if quitting:
exit_now = True
elif request:
# Interrupted while executing a request, as when debugging.
print_exception()
rpc.response_queue.put((seq, None))
continue
except SystemExit:
capture_warnings(False)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix a hang of the IDLE Shell when code run under the debugger raises
:exc:`KeyboardInterrupt`.
Loading