diff --git a/pylint/config/find_default_config_files.py b/pylint/config/find_default_config_files.py index 8733794a602..03afa89c905 100644 --- a/pylint/config/find_default_config_files.py +++ b/pylint/config/find_default_config_files.py @@ -61,7 +61,10 @@ def _cfg_has_config(path: Path | str) -> bool: parser.read(path, encoding="utf-8") except configparser.Error: return False - return any(section.startswith("pylint.") for section in parser.sections()) + return any( + section == "[pylint]" or section.startswith("pylint.") + for section in parser.sections() + ) def _yield_default_files() -> Iterator[Path]: