Skip to content

Commit e596c2a

Browse files
authored
Merge pull request #3038 from CoolCat467/mypy-1.11.0
Update to mypy 1.11.0
2 parents c06f9e9 + 5861521 commit e596c2a

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/trio/_core/_ki.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def decorator(fn: Callable[ArgsT, RetT]) -> Callable[ArgsT, RetT]:
143143
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT: # type: ignore[misc]
144144
# See the comment for regular generators below
145145
coro = fn(*args, **kwargs)
146+
assert coro.cr_frame is not None, "Coroutine frame should exist"
146147
coro.cr_frame.f_locals[LOCALS_KEY_KI_PROTECTION_ENABLED] = enabled
147148
return coro # type: ignore[return-value]
148149

src/trio/_core/_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,7 @@ async def python_wrapper(orig_coro: Awaitable[RetT]) -> RetT:
17821782
return await orig_coro
17831783

17841784
coro = python_wrapper(coro)
1785+
assert coro.cr_frame is not None, "Coroutine frame should exist"
17851786
coro.cr_frame.f_locals.setdefault(LOCALS_KEY_KI_PROTECTION_ENABLED, system_task)
17861787

17871788
######

src/trio/_tests/test_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def test_fixup_module_metadata() -> None:
269269
assert mod.SomeClass.method.__module__ == "trio.somemodule" # type: ignore[attr-defined]
270270
assert mod.SomeClass.method.__qualname__ == "SomeClass.method" # type: ignore[attr-defined]
271271
# Make coverage happy.
272-
non_trio_module.some_func() # type: ignore[no-untyped-call]
273-
mod.some_func() # type: ignore[no-untyped-call]
274-
mod._private() # type: ignore[no-untyped-call]
272+
non_trio_module.some_func()
273+
mod.some_func()
274+
mod._private()
275275
mod.SomeClass().method()

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ markupsafe==2.1.5
7171
# via jinja2
7272
mccabe==0.7.0
7373
# via pylint
74-
mypy==1.10.1 ; implementation_name == 'cpython'
74+
mypy==1.11.0 ; implementation_name == 'cpython'
7575
# via -r test-requirements.in
7676
mypy-extensions==1.0.0 ; implementation_name == 'cpython'
7777
# via

0 commit comments

Comments
 (0)