diff --git a/pylint/pyreverse/main.py b/pylint/pyreverse/main.py index 452059458d..3ba0b6c77d 100644 --- a/pylint/pyreverse/main.py +++ b/pylint/pyreverse/main.py @@ -14,7 +14,7 @@ from pylint.config.arguments_manager import _ArgumentsManager from pylint.config.arguments_provider import _ArgumentsProvider from pylint.lint import discover_package_path -from pylint.lint.utils import augmented_sys_path, realpath_transformer +from pylint.lint.utils import augmented_sys_path from pylint.pyreverse import writer from pylint.pyreverse.diadefslib import DiadefsHandler from pylint.pyreverse.inspector import Linker, project_from_files @@ -304,11 +304,7 @@ def run(self, args: list[str]) -> int: extra_packages_paths = list( {discover_package_path(arg, self.config.source_roots) for arg in args} ) - # Prefer package paths detected per module over global PYTHONPATH additions - extra_sys_paths = extra_packages_paths + realpath_transformer( - self.config.pythonpath - ) - with augmented_sys_path(extra_sys_paths): + with augmented_sys_path(extra_packages_paths): project = project_from_files( args, project_name=self.config.project,