diff --git a/doc/whatsnew/fragments/9883.bugfix b/doc/whatsnew/fragments/9883.bugfix new file mode 100644 index 0000000000..51a1a935c0 --- /dev/null +++ b/doc/whatsnew/fragments/9883.bugfix @@ -0,0 +1,3 @@ +Fix to address indeterminacy of error message in case a module name is same as another in a separate namespace. + +Refs #9883 diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index eff15cc444..dce95e0036 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -666,10 +666,12 @@ def check(self, files_or_modules: Sequence[str]) -> None: ) extra_packages_paths = list( - { - discover_package_path(file_or_module, self.config.source_roots) - for file_or_module in files_or_modules - } + dict.fromkeys( + [ + discover_package_path(file_or_module, self.config.source_roots) + for file_or_module in files_or_modules + ] + ).keys() ) # TODO: Move the parallel invocation into step 3 of the checking process diff --git a/tests/functional/r/recursion/recursion_error_3152.py b/tests/functional/r/recursion/recursion_error_3152.py index 97ec190e8f..2d7de55079 100644 --- a/tests/functional/r/recursion/recursion_error_3152.py +++ b/tests/functional/r/recursion/recursion_error_3152.py @@ -2,6 +2,6 @@ import setuptools -# pylint: disable=missing-docstring,too-few-public-methods +# pylint: disable=missing-docstring,too-few-public-methods,abstract-method class Custom(setuptools.Command): pass