Path 1: 3 calls (0.75)

PosixPath (3)

False (2) True (1)

GeneratorExit (1)

1def _cfg_has_config(path: Path | str) -> bool:
2    parser = configparser.ConfigParser()
3    try:
4        parser.read(path, encoding="utf-8")
5    except configparser.Error:
6        return False
7    return any(section.startswith("pylint.") for section in parser.sections())
            

Path 2: 1 calls (0.25)

PosixPath (1)

False (1)

MissingSectionHeaderError (1)

1def _cfg_has_config(path: Path | str) -> bool:
2    parser = configparser.ConfigParser()
3    try:
4        parser.read(path, encoding="utf-8")
5    except configparser.Error:
6        return False
7    return any(section.startswith("pylint.") for section in parser.sections())