Skip to content

Commit

Permalink
Remove InvalidVersion exception catch
Browse files Browse the repository at this point in the history
  • Loading branch information
notatallshaw committed Oct 13, 2024
1 parent ec5faea commit a31e7d2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pip/_internal/index/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from pip._vendor.packaging.utils import (
InvalidSdistFilename,
InvalidVersion,
InvalidWheelFilename,
canonicalize_name,
parse_sdist_filename,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a31e7d2

Please sign in to comment.