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

Class ExThread

tests/test_filelock.py:224–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls