diff --git a/distutils/dist.py b/distutils/dist.py index 1dc25fe5..9c98c16c 100644 --- a/distutils/dist.py +++ b/distutils/dist.py @@ -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(file) if DEBUG: self.announce("using config files: %s" % ', '.join(files))