Skip to content

Commit

Permalink
Suppress OSError when searching config files
Browse files Browse the repository at this point in the history
Fixes pypa#181

Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Sep 28, 2022
1 parent d2529ff commit d6adb6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion distutils/dist.py
Expand Up @@ -334,7 +334,11 @@ def find_config_files(self):
- a file named by an environment variable
"""
check_environ()
files = [str(path) for path in self._gen_paths() if path.is_file()]
files = []
for path in self._gen_paths():
with contextlib.suppress(OSError):
if path.is_file():
files.append(path)

if DEBUG:
self.announce("using config files: %s" % ', '.join(files))
Expand Down

0 comments on commit d6adb6d

Please sign in to comment.