File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,16 +58,25 @@ class ConditionalThreadPoolExecutor(Executor):
5858
5959 def __init__ (
6060 self ,
61- max_workers : Optional [int ] = None ,
62- ** kwargs : Any ,
61+ max_workers : int | None = None ,
62+ thread_name_prefix : str = '' ,
63+ initializer : Callable [..., object ] | None = None ,
64+ initargs : tuple [Any , ...] = (),
6365 ) -> None :
6466 self ._max_workers = max_workers
65- self ._kwargs = kwargs
67+ self ._thread_name_prefix = thread_name_prefix
68+ self ._initializer = initializer
69+ self ._initargs = initargs
6670 self ._executor : Executor
6771
6872 def __enter__ (self ) -> 'ConditionalThreadPoolExecutor' :
6973 self ._executor = (
70- ThreadPoolExecutor (max_workers = self ._max_workers , ** self ._kwargs )
74+ ThreadPoolExecutor (
75+ max_workers = self ._max_workers ,
76+ thread_name_prefix = self ._thread_name_prefix ,
77+ initializer = self ._initializer ,
78+ initargs = self ._initargs ,
79+ )
7180 if is_no_gil ()
7281 else SingleThreadExecutor ()
7382 )
You can’t perform that action at this time.
0 commit comments