Skip to content

Commit 89e7208

Browse files
sbidouluranusjr
andauthored
Improve readability
Co-authored-by: Tzu-ping Chung <[email protected]>
1 parent d4274db commit 89e7208

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/pip/_internal/models/link.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ def parse_pep658_hash(cls, dist_info_metadata: str) -> Optional["LinkHash"]:
7474
"""Parse a PEP 658 data-dist-info-metadata hash."""
7575
if dist_info_metadata == "true":
7676
return None
77-
try:
78-
name, value = dist_info_metadata.split("=", 1)
79-
except ValueError:
77+
name, sep, value = dist_info_metadata.partition("=")
78+
if not sep:
8079
return None
8180
if name not in _SUPPORTED_HASHES:
8281
return None

0 commit comments

Comments
 (0)