From a31e7d2ecdfb36144fae44a10ae266b78919f8ac Mon Sep 17 00:00:00 2001 From: Damian Shaw Date: Sun, 13 Oct 2024 13:56:05 -0400 Subject: [PATCH] Remove InvalidVersion exception catch --- src/pip/_internal/index/sources.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pip/_internal/index/sources.py b/src/pip/_internal/index/sources.py index f4626d71ab4..3dafb30e6eb 100644 --- a/src/pip/_internal/index/sources.py +++ b/src/pip/_internal/index/sources.py @@ -6,7 +6,6 @@ from pip._vendor.packaging.utils import ( InvalidSdistFilename, - InvalidVersion, InvalidWheelFilename, canonicalize_name, parse_sdist_filename, @@ -68,10 +67,10 @@ def _scan_directory(self) -> None: # otherwise not worth considering as a package try: project_filename = parse_wheel_filename(entry.name)[0] - except (InvalidWheelFilename, InvalidVersion): + except InvalidWheelFilename: try: project_filename = parse_sdist_filename(entry.name)[0] - except (InvalidSdistFilename, InvalidVersion): + except InvalidSdistFilename: continue self._project_name_to_urls[project_filename].append(url)