From 5ab2e97605d57904a219660f1f4c1b166144695b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 15 Sep 2021 17:08:41 +0100 Subject: [PATCH] Thread exception handling --- threads.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/threads.py b/threads.py index a8979b71c..f56f1f519 100644 --- a/threads.py +++ b/threads.py @@ -46,8 +46,12 @@ class threadWithTrace(threading.Thread): def __run(self): sys.settrace(self.globaltrace) - self.__run_backup() - self.run = self.__run_backup + try: + self.__run_backup() + self.run = self.__run_backup + except Exception as e: + print('ERROR: threads.py/__run failed - ' + str(e)) + pass def globaltrace(self, frame, event, arg): if event == 'call':