Skip to content

Commit

Permalink
Merge pull request #3038 from CoolCat467/mypy-1.11.0
Browse files Browse the repository at this point in the history
Update to mypy 1.11.0
  • Loading branch information
Zac-HD committed Jul 23, 2024
2 parents c06f9e9 + 5861521 commit e596c2a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/trio/_core/_ki.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def decorator(fn: Callable[ArgsT, RetT]) -> Callable[ArgsT, RetT]:
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT: # type: ignore[misc]
# See the comment for regular generators below
coro = fn(*args, **kwargs)
assert coro.cr_frame is not None, "Coroutine frame should exist"
coro.cr_frame.f_locals[LOCALS_KEY_KI_PROTECTION_ENABLED] = enabled
return coro # type: ignore[return-value]

Expand Down
1 change: 1 addition & 0 deletions src/trio/_core/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,7 @@ async def python_wrapper(orig_coro: Awaitable[RetT]) -> RetT:
return await orig_coro

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

######
Expand Down
6 changes: 3 additions & 3 deletions src/trio/_tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_fixup_module_metadata() -> None:
assert mod.SomeClass.method.__module__ == "trio.somemodule" # type: ignore[attr-defined]
assert mod.SomeClass.method.__qualname__ == "SomeClass.method" # type: ignore[attr-defined]
# Make coverage happy.
non_trio_module.some_func() # type: ignore[no-untyped-call]
mod.some_func() # type: ignore[no-untyped-call]
mod._private() # type: ignore[no-untyped-call]
non_trio_module.some_func()
mod.some_func()
mod._private()
mod.SomeClass().method()
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via pylint
mypy==1.10.1 ; implementation_name == 'cpython'
mypy==1.11.0 ; implementation_name == 'cpython'
# via -r test-requirements.in
mypy-extensions==1.0.0 ; implementation_name == 'cpython'
# via
Expand Down

0 comments on commit e596c2a

Please sign in to comment.