MCPcopy Create free account
hub / github.com/tox-dev/filelock / ExThread

Class ExThread

tests/test_filelock.py:228–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226
227
228class ExThread(threading.Thread):
229 def __init__(self, target: Callable[[], None], name: str) -> None:
230 super().__init__(target=target, name=name)
231 self.ex: _ExcInfoType | None = None
232
233 def run(self) -> None:
234 try:
235 super().run()
236 except Exception: # pragma: no cover
237 self.ex = sys.exc_info() # pragma: no cover
238
239 def join(self, timeout: float | None = None) -> None:
240 super().join(timeout=timeout)
241 if self.ex is not None:
242 raise RuntimeError from self.ex[1] # pragma: no cover
243
244
245@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…