Skip to content

Commit 8314743

Browse files
authored
Fix to maintain order of package paths (#9887)
1 parent 724fd5e commit 8314743

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

doc/whatsnew/fragments/9883.bugfix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix to address indeterminacy of error message in case a module name is same as another in a separate namespace.
2+
3+
Refs #9883

pylint/lint/pylinter.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,12 @@ def check(self, files_or_modules: Sequence[str]) -> None:
665665
)
666666

667667
extra_packages_paths = list(
668-
{
669-
discover_package_path(file_or_module, self.config.source_roots)
670-
for file_or_module in files_or_modules
671-
}
668+
dict.fromkeys(
669+
[
670+
discover_package_path(file_or_module, self.config.source_roots)
671+
for file_or_module in files_or_modules
672+
]
673+
).keys()
672674
)
673675

674676
# TODO: Move the parallel invocation into step 3 of the checking process

0 commit comments

Comments
 (0)