mirror of
https://github.com/element-hq/synapse.git
synced 2026-09-29 09:18:03 +00:00
Bump mypy from 1.13.0 to 1.16.1 (#18653)
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
import functools
|
||||
import sys
|
||||
from types import GeneratorType
|
||||
from typing import Any, Callable, Generator, List, TypeVar, cast
|
||||
|
||||
from typing_extensions import ParamSpec
|
||||
@@ -151,6 +152,12 @@ def _check_yield_points(
|
||||
) -> Generator["Deferred[object]", object, T]:
|
||||
gen = f(*args, **kwargs)
|
||||
|
||||
# We only patch if we have a native generator function, as we rely on
|
||||
# `gen.gi_frame`.
|
||||
if not isinstance(gen, GeneratorType):
|
||||
ret = yield from gen
|
||||
return ret
|
||||
|
||||
last_yield_line_no = gen.gi_frame.f_lineno
|
||||
result: Any = None
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user