From d6adb6d84283781469ee4c2c0f26fb315b44de28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Wed, 28 Sep 2022 18:56:11 +0100 Subject: [PATCH] Suppress OSError when searching config files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #181 Signed-off-by: Filipe LaĆ­ns --- distutils/dist.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/distutils/dist.py b/distutils/dist.py index 1dc25fe5..c49adb7c 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(path) if DEBUG: self.announce("using config files: %s" % ', '.join(files))