File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ def _find_config_file(path: str) -> Optional[str]:
2929 home_stat = None
3030
3131 dir_stat = _stat_key (path )
32- cfg = configparser .RawConfigParser ()
3332 while True :
3433 for candidate in ("setup.cfg" , "tox.ini" , ".flake8" ):
34+ cfg = configparser .RawConfigParser ()
3535 cfg_path = os .path .join (path , candidate )
3636 try :
3737 cfg .read (cfg_path , encoding = "UTF-8" )
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ def test_config_file_without_section_is_not_considered(tmp_path):
2121
2222
2323def test_config_file_with_parse_error_is_not_considered (tmp_path , caplog ):
24- tmp_path .joinpath ("setup.cfg" ).write_text ("[error" )
24+ # the syntax error here is deliberately to trigger a partial parse
25+ # https://github.com/python/cpython/issues/95546
26+ tmp_path .joinpath ("setup.cfg" ).write_text ("[flake8]\n x = 1\n ..." )
2527
2628 assert config ._find_config_file (str (tmp_path )) is None
2729
You can’t perform that action at this time.
0 commit comments