Skip to content

Commit 83fb38f

Browse files
committed
Suppress OSError when searching config files
Fixes pypa#181 Signed-off-by: Filipe Laíns <[email protected]>
1 parent d2529ff commit 83fb38f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

distutils/dist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ def find_config_files(self):
334334
- a file named by an environment variable
335335
"""
336336
check_environ()
337-
files = [str(path) for path in self._gen_paths() if path.is_file()]
337+
files = []
338+
for path in self._gen_paths():
339+
with contextlib.suppress(OSError):
340+
if path.is_file():
341+
files.append(str(path))
338342

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

0 commit comments

Comments
 (0)