Skip to content

Commit 13f70d7

Browse files
committed
Fix pre-commit errors
1 parent 238fac5 commit 13f70d7

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

news/13443.bugfix.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Handle malformed version metadata entires and ignore packages
1+
Handle malformed version metadata entries and ignore packages
22
with invalid ``Version`` instead of crashing.

src/pip/_internal/metadata/importlib/_dists.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ def version(self) -> Version:
173173
)
174174
return parse_version(version)
175175
except TypeError:
176-
raise BadMetadata(
177-
self._dist.files[3], reason="invalid metadata entry `version`"
178-
)
176+
raise BadMetadata(self._dist, reason="invalid metadata entry `version`")
179177

180178
@property
181179
def raw_version(self) -> str:

src/pip/_internal/metadata/importlib/_envs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _find_impl(self, location: str) -> Iterator[FoundResult]:
6969
try:
7070
name = get_dist_canonical_name(dist)
7171
distribution = Distribution(dist, info_location, None)
72-
version = distribution.version
72+
getattr(distribution, "version")
7373
except BadMetadata as e:
7474
logger.warning("Skipping %s due to %s", info_location, e.reason)
7575
continue

0 commit comments

Comments
 (0)