Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
IDLE: Handle sys.excepthook errors...
...when raising in 2-process mode, in a way that matches normal shell behavior.
  • Loading branch information
Kenny2github authored Jan 23, 2021
commit a11fa374e0f2818cf213d326901703f5fa8f107e
8 changes: 7 additions & 1 deletion Lib/idlelib/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,13 @@ def runcode(self, code):
if sys.excepthook is sys.__excepthook__:
print_exception()
else:
sys.excepthook(*self.usr_exc_info)
try:
sys.excepthook(*self.usr_exc_info)
except:
print_exception()
print("\nDuring handling of the above exception, another exception occurred:\n", file=sys.stderr)
self.usr_exc_info = sys.exc_info()
print_exception()
jit = self.rpchandler.console.getvar("<<toggle-jit-stack-viewer>>")
if jit:
self.rpchandler.interp.open_remote_stack_viewer()
Expand Down