MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / PropagatingThread

Class PropagatingThread

KVCOMM/tools/coding/executor_utils.py:15–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14
15class PropagatingThread(Thread):
16 def run(self):
17 self.exc = None
18 try:
19 if hasattr(self, '_Thread__target'):
20
21 self.ret = self._Thread__target(*self._Thread__args, **self._Thread__kwargs)
22 else:
23 self.ret = self._target(*self._args, **self._kwargs)
24 except BaseException as e:
25 self.exc = e
26
27 def join(self, timeout=None):
28 super(PropagatingThread, self).join(timeout)
29 if self.exc:
30 raise self.exc
31 return self.ret
32
33
34def function_with_timeout(func, args, timeout):

Callers 1

function_with_timeoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected