Skip to content

Commit 12a530b

Browse files
committedMar 23, 2024
Fix types and type linting
1 parent c57d4b9 commit 12a530b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

Diff for: ‎twine/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ def dispatch(argv: List[str]) -> Any:
118118

119119
configure_output()
120120

121-
main = registered_commands[args.command].load() # type: ignore[no-untyped-call] # python/importlib_metadata#288 # noqa: E501
121+
main = registered_commands[args.command].load()
122122

123123
return main(args.args)

Diff for: ‎twine/wheel.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
import zipfile
1818
from typing import List, Optional
19+
from typing import cast as type_cast
1920

2021
from pkginfo import distribution
2122

@@ -87,5 +88,7 @@ def parse(self, data: bytes) -> None:
8788
super().parse(data)
8889

8990
fp = io.StringIO(data.decode("utf-8", errors="replace"))
91+
# msg is ``email.message.Message`` which is a legacy API documented
92+
# here: https://docs.python.org/3/library/email.compat32-message.html
9093
msg = distribution.parse(fp)
91-
self.description = msg.get_payload()
94+
self.description = type_cast(str, msg.get_payload())

0 commit comments

Comments
 (0)