--- a/src/eric7/DebugClients/Python/DebugClientBase.py Fri Feb 02 13:33:55 2024 +0100 +++ b/src/eric7/DebugClients/Python/DebugClientBase.py Fri Feb 02 14:33:16 2024 +0100 @@ -205,6 +205,8 @@ self.callTraceOptimization = False + self.__debugeeExceptHook = None + def getCoding(self): """ Public method to return the current coding. @@ -1240,6 +1242,22 @@ """ self.mainThread.user_exception((exctype, excval, exctb), True) + if self.__debugeeExceptHook is not None: + # call the exception hook of the program being debugged + self.__debugeeExceptHook(exctype, excval, exctb) + + def checkExceptionHook(self): + """ + Public method to check, that 'sys.excepthook' is still our hook. + + If the exception hook has been changed by the program being debugger, save + that hook and set it to ours again. The program's hook is called in our + '__unhandled_exception()' method. + """ + if sys.excepthook != self.__unhandled_exception: + self.__debugeeExceptHook = sys.excepthook + sys.excepthook = self.__unhandled_exception + def __interceptSignals(self): """ Private method to intercept common signals.