From 26d81add1e1b07227747ae961e9e95817116008f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 16 Oct 2019 22:01:28 +0100 Subject: [PATCH] Restore retries --- threads.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/threads.py b/threads.py index 9db10231d..c0dc7066e 100644 --- a/threads.py +++ b/threads.py @@ -44,20 +44,17 @@ class threadWithTrace(threading.Thread): self.isStarted=True def __run(self): - sys.settrace(self.globaltrace) - self.__run_backup() - self.run = self.__run_backup - #tries=0 - #while tries<3: - # try: - # sys.settrace(self.globaltrace) - # self.__run_backup() - # self.run = self.__run_backup - # break - # except Exception as e: - # print('ERROR: threads.py/__run failed - '+str(e)) - # time.sleep(1) - # tries+=1 + tries=0 + while tries<3: + try: + sys.settrace(self.globaltrace) + self.__run_backup() + self.run = self.__run_backup + break + except Exception as e: + print('ERROR: threads.py/__run failed - '+str(e)) + time.sleep(1) + tries+=1 def globaltrace(self, frame, event, arg): if event == 'call':