Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/annetbox/base/client_sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import http
import logging
import atexit
from abc import abstractmethod
from collections.abc import Callable, Iterable
from functools import wraps
Expand Down Expand Up @@ -233,7 +234,10 @@ def _init_session(

def _init_pool(self, threads: int) -> _BasePool:
if threads > 1:
return ThreadPool(processes=threads)
pool = ThreadPool(processes=threads)
atexit.register(pool.terminate)
return pool

return FakePool()


Expand Down
Loading