diff --git a/Lib/test/libregrtest/run_workers.py b/Lib/test/libregrtest/run_workers.py index 1a14177e51ab7d..dff631f09c5abf 100644 --- a/Lib/test/libregrtest/run_workers.py +++ b/Lib/test/libregrtest/run_workers.py @@ -433,7 +433,8 @@ def run(self) -> None: def _wait_completed(self) -> None: popen = self._popen # only needed for mypy: - assert popen is not None, "Should never call `._popen` before `.run()`" + if popen is None: + raise ValueError("Should never call `._popen` before `.run()`") try: popen.wait(WAIT_COMPLETED_TIMEOUT)