Skip to content

Commit eff1b48

Browse files
committed
fix: use WorkerPool.shutdown() in _reset_pool to avoid union-attr mypy error
_reset_pool accessed _pool._pool.shutdown() directly but mypy can't narrow the inner ProcessPoolExecutor | None to non-None. Replaced with a call to the public shutdown() method which already handles the check.
1 parent 5a160a1 commit eff1b48

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/core/worker_pool.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,5 @@ def _reset_pool() -> None:
300300
"""Force-shutdown and recreate the global worker pool."""
301301
global _pool
302302
if _pool is not None:
303-
try:
304-
_pool._pool.shutdown(wait=False, cancel_futures=True)
305-
except Exception:
306-
pass
303+
_pool.shutdown()
307304
_pool = None

0 commit comments

Comments
 (0)