mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 12:36:54 +00:00
skip skipping home if home does not exist
This commit is contained in:
parent
446b18d35a
commit
8b51ee4ea5
2 changed files with 11 additions and 1 deletions
|
|
@ -23,7 +23,10 @@ def _stat_key(s: str) -> Tuple[int, int]:
|
|||
def _find_config_file(path: str) -> Optional[str]:
|
||||
# on windows if the homedir isn't detected this returns back `~`
|
||||
home = os.path.expanduser("~")
|
||||
home_stat = _stat_key(home) if home != "~" else None
|
||||
try:
|
||||
home_stat = _stat_key(home) if home != "~" else None
|
||||
except OSError: # FileNotFoundError / PermissionError / etc.
|
||||
home_stat = None
|
||||
|
||||
dir_stat = _stat_key(path)
|
||||
cfg = configparser.RawConfigParser()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue