diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index 3b0d8247..773b8fc1 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -474,7 +474,12 @@ def make_file(name, hash=None, size_str=None): @pass_none def make_files(lines): - return list(starmap(make_file, csv.reader(lines))) + return list( + filter( + lambda package_path: package_path.locate().exists(), + list(starmap(make_file, csv.reader(lines))), + ) + ) return make_files( self._read_files_distinfo()