3636
3737
3838def _worker_initialize (
39- linter : bytes , extra_packages_paths : Sequence [str ] | None = None
39+ linter : bytes , extra_sys_paths : Sequence [str ] | None = None
4040) -> None :
4141 """Function called to initialize a worker for a Process within a concurrent Pool.
4242
4343 :param linter: A linter-class (PyLinter) instance pickled with dill
44- :param extra_packages_paths : Extra entries to be added to `sys.path`
44+ :param extra_sys_paths : Extra entries to be added to `sys.path`
4545 """
4646 global _worker_linter # pylint: disable=global-statement
4747 _worker_linter = dill .loads (linter )
@@ -57,8 +57,8 @@ def _worker_initialize(
5757 _worker_linter .load_plugin_modules (_worker_linter ._dynamic_plugins , force = True )
5858 _worker_linter .load_plugin_configuration ()
5959
60- if extra_packages_paths :
61- _augment_sys_path (extra_packages_paths )
60+ if extra_sys_paths :
61+ _augment_sys_path (extra_sys_paths )
6262
6363
6464def _worker_check_single_file (
@@ -125,7 +125,7 @@ def check_parallel(
125125 linter : PyLinter ,
126126 jobs : int ,
127127 files : Iterable [FileItem ],
128- extra_packages_paths : Sequence [str ] | None = None ,
128+ extra_sys_paths : Sequence [str ] | None = None ,
129129) -> None :
130130 """Use the given linter to lint the files with given amount of workers (jobs).
131131
@@ -135,9 +135,7 @@ def check_parallel(
135135 # The linter is inherited by all the pool's workers, i.e. the linter
136136 # is identical to the linter object here. This is required so that
137137 # a custom PyLinter object can be used.
138- initializer = functools .partial (
139- _worker_initialize , extra_packages_paths = extra_packages_paths
140- )
138+ initializer = functools .partial (_worker_initialize , extra_sys_paths = extra_sys_paths )
141139 with ProcessPoolExecutor (
142140 max_workers = jobs , initializer = initializer , initargs = (dill .dumps (linter ),)
143141 ) as executor :
0 commit comments