blob: 999f0f4359be273ef7e4fb3ff590883a45b4e6e6 [file] [log] [blame]
From 7e53ba97410d1e5c59d142c8fdeba578f555ebaf Mon Sep 17 00:00:00 2001
From: Brian Ryner <>
Date: Thu, 5 Aug 2021 19:22:35 +0000
Subject: [PATCH] Changes to improve multiprocessing PRESUBMIT support in
* fix bug in pylint which caused it to manipulate sys.path before
spawning its subprocesses, which caused multiprocessing to fail
on windows (DIFF1).
* Note: This may carry a slight semantic change. Before, pylint would
add all .py files' directories to sys.path while checking any of
them. Now in parallel mode, pylint will only add the path of the
single file to sys.path. This behavior actually mirrors Python's
own behavior, so the check should be more-correct than before (and
should cut down on pylint import scanning time with very large
* If someone encounters an issue with this, please note that the
GetPylint check also includes an extra_paths_list which is
expressly for this purpose.,,
Review URL:
pylint/ | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pylint/ b/pylint/
index c5f9328f..1d940654 100644
--- a/pylint/
+++ b/pylint/
@@ -733,7 +733,8 @@ class PyLinter(config.OptionsManagerMixIn,
files_or_modules = (files_or_modules,)
if == 1:
- self._do_check(files_or_modules)
+ with fix_import_path(files_or_modules):
+ self._do_check(files_or_modules)
with _patch_sysmodules():