Skip to content

Commit fed3e42

Browse files
committed
Fix bug uncovered by unittests discovered on Windows
1 parent 6ef3156 commit fed3e42

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pylint/lint/expand_modules.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ def discover_package_path(
3535
# Look for a source root that contains the module directory
3636
for source_root in source_roots:
3737
source_root = os.path.realpath(os.path.expanduser(source_root))
38-
if os.path.commonpath([source_root, dirname]) == source_root:
39-
return [source_root]
38+
try:
39+
if os.path.commonpath([source_root, dirname]) == source_root:
40+
return [source_root]
41+
except ValueError:
42+
continue
4043

4144
if len(source_roots) != 0:
4245
return source_roots

0 commit comments

Comments
 (0)