慢慢改bug

This commit is contained in:
2022-02-02 15:09:11 +08:00
parent 073ae827ab
commit 99509be48c
13 changed files with 47 additions and 29 deletions

View File

@ -10,14 +10,14 @@ class NewThread(threading.Thread):
super(NewThread, self).__init__()
self.func = func
self.args = args
self.result = None
def run(self):
self.result = self.func(*self.args)
def getResult(self):
threading.Thread.join(self) # 等待线程执行完毕
try:
return self.result
except Exception:
return None
return self.result
#
# ————————————————