Skip to content

Commit 666c163

Browse files
authored
Merge branch 'main' into structured-obsolete-since
2 parents 0bff8a5 + ed637dd commit 666c163

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/ts_utils/metadata.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ def read_metadata(distribution: str) -> StubMetadata:
238238
"""
239239
try:
240240
with metadata_path(distribution).open("rb") as f:
241-
data: dict[str, object] = tomllib.load(f)
241+
# This cast is necessary for pyright to understand that the
242+
# variable is a dict with object values. Just using
243+
# `data: dict[str, object] = tomlkit.load(f)` doesn't work because
244+
# pyright still infers TOMLDocument which derives from
245+
# dict[Unknown, Unknown].
246+
data = cast(dict[str, object], tomlkit.load(f))
242247
except FileNotFoundError:
243248
raise NoSuchStubError(f"Typeshed has no stubs for {distribution!r}!") from None
244249

stubs/pika/pika/adapters/blocking_connection.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class BlockingConnection:
7171
def remove_timeout(self, timeout_id) -> None: ...
7272
def update_secret(self, new_secret, reason) -> None: ...
7373
def close(self, reply_code: int = 200, reply_text: str = "Normal shutdown") -> None: ...
74-
def process_data_events(self, time_limit: int = 0): ...
74+
def process_data_events(self, time_limit: int | None = 0) -> None: ...
7575
def sleep(self, duration: float) -> None: ...
7676
def channel(self, channel_number: int | None = None) -> BlockingChannel: ...
7777
@property

0 commit comments

Comments
 (0)