the most recent greenlet/asyncio commit introduced a typing error
that only comes up under python3.10 due to the non-presence of
asyncio.Runner in that version. do an intricate dance here along with
another python-version-specific thing observed around the greenlet
import.
Change-Id: I1b220ab8ea633cdf43ad7e8abe826f758858b62a
return asyncio.get_event_loop_policy().get_event_loop()
-if py311:
+if not TYPE_CHECKING and py311:
_Runner = asyncio.Runner
else:
- class _Runner: # type: ignore[no-redef]
+ class _Runner:
"""Runner implementation for test only"""
_loop: Union[None, asyncio.AbstractEventLoop, Literal[False]]
have_greenlet = False
greenlet_error = None
try:
- import greenlet # type: ignore # noqa: F401
+ import greenlet # type: ignore[import-untyped,unused-ignore] # noqa: F401,E501
except ImportError as e:
greenlet_error = str(e)
pass