From: Daniele Varrazzo Date: Tue, 23 Feb 2021 22:39:44 +0000 (+0100) Subject: Use the daemon param at constructor rather than the attribute X-Git-Tag: 3.0.dev0~87^2~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b19b3ee22366aadf8820878ff7c601b7b786c2b4;p=thirdparty%2Fpsycopg.git Use the daemon param at constructor rather than the attribute --- diff --git a/psycopg3/psycopg3/pool.py b/psycopg3/psycopg3/pool.py index 2e3b65578..bf944477f 100644 --- a/psycopg3/psycopg3/pool.py +++ b/psycopg3/psycopg3/pool.py @@ -97,12 +97,14 @@ class ConnectionPool: self._wqueue: "Queue[MaintenanceTask]" = Queue() self._workers: List[threading.Thread] = [] for i in range(num_workers): - t = threading.Thread(target=self.worker, args=(self._wqueue,)) - t.daemon = True + t = threading.Thread( + target=self.worker, args=(self._wqueue,), daemon=True + ) self._workers.append(t) - self._sched_runner = threading.Thread(target=self._sched.run) - self._sched_runner.daemon = True + self._sched_runner = threading.Thread( + target=self._sched.run, daemon=True + ) # _close should be the last property to be set in the state # to avoid warning on __del__ in case __init__ fails.