From 4119720f69883cbfb2a7d12b7b9ae67f6e758ae7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 21 Apr 2023 21:46:08 -0400 Subject: [PATCH] Resolve the located directory and remove suppression of Exceptions. Ref python/cpython#103661. --- importlib_metadata/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index e9ae0d19..3c4e0a25 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -536,12 +536,12 @@ def _read_files_egginfo_installed(self): subdir = getattr(self, '_path', None) if not text or not subdir: return - with contextlib.suppress(Exception): - ret = [ - str((subdir / line).resolve().relative_to(self.locate_file(''))) - for line in text.splitlines() - ] - return map('"{}"'.format, ret) + + ret = [ + str((subdir / line).resolve().relative_to(self.locate_file('').resolve())) + for line in text.splitlines() + ] + return map('"{}"'.format, ret) def _read_files_egginfo_sources(self): """