Skip to content

Commit

Permalink
Fix bug uncovered by unittests discovered on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
akamat10 committed Sep 29, 2024
1 parent 6ef3156 commit fed3e42
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pylint/lint/expand_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ def discover_package_path(
# Look for a source root that contains the module directory
for source_root in source_roots:
source_root = os.path.realpath(os.path.expanduser(source_root))
if os.path.commonpath([source_root, dirname]) == source_root:
return [source_root]
try:
if os.path.commonpath([source_root, dirname]) == source_root:
return [source_root]
except ValueError:
continue

Check warning on line 42 in pylint/lint/expand_modules.py

View check run for this annotation

Codecov / codecov/patch

pylint/lint/expand_modules.py#L41-L42

Added lines #L41 - L42 were not covered by tests

if len(source_roots) != 0:
return source_roots
Expand Down

0 comments on commit fed3e42

Please sign in to comment.