Skip to content

Commit 190ea6a

Browse files
committed
Remove strict_optional=False for models/link.py.
1 parent 0baec60 commit 190ea6a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ strict_optional = False
5353
[mypy-pip/_internal/models/format_control]
5454
strict_optional = False
5555

56-
[mypy-pip/_internal/models/link]
57-
strict_optional = False
58-
5956
[mypy-pip/_internal/operations/check]
6057
strict_optional = False
6158

src/pip/_internal/models/link.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,8 @@ def is_hash_allowed(self, hashes):
206206
"""
207207
if not self.has_hash:
208208
return False
209+
# Assert non-None so mypy knows self.hash_name and self.hash are str.
210+
assert self.hash_name is not None
211+
assert self.hash is not None
209212

210213
return hashes.is_hash_allowed(self.hash_name, hex_digest=self.hash)

0 commit comments

Comments
 (0)