diff --git a/prospector/tools/pep8/__init__.py b/prospector/tools/pep8/__init__.py index 048e2e49..b15d9286 100644 --- a/prospector/tools/pep8/__init__.py +++ b/prospector/tools/pep8/__init__.py @@ -133,11 +133,9 @@ def configure(self, prospector_config, found_files): if len(package) == 1: check_paths.add(package_path) continue - for i in range(1, len(package)): - if os.path.join(*package[:-i]) in check_paths: - break - else: - check_paths.add(package_path) + if os.path.join(*package) in check_paths: + continue + check_paths.add(package_path) for filepath in found_files.iter_module_paths(abspath=False): package = os.path.dirname(filepath).split(os.path.sep)