| 222 | |
| 223 | |
| 224 | class 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]) |
no outgoing calls