Skip to content

Commit

Permalink
fix[typing]: add assertion to narrow type
Browse files Browse the repository at this point in the history
Fixes failure with mypy 1.9.0.
  • Loading branch information
dairiki committed Mar 14, 2024
1 parent fd57640 commit bdd1eca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hatch_zipped_directory/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def metadata_to_json(metadata: str) -> dict[str, str | list[str]]:
headers = email.message_from_string(metadata)
assert not headers.is_multipart()
description = headers.get_payload()
assert isinstance(description, str)

data: dict[str, str | list[str]] = {}
for key in headers:
Expand Down

0 comments on commit bdd1eca

Please sign in to comment.