Skip to content

Commit 540e6ab

Browse files
committed
Fix dunder in class
1 parent 20241b0 commit 540e6ab

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

uvloop/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99

1010

1111
__all__: tuple[str, ...] = ('new_event_loop',)
12+
_AbstractEventLoop = __asyncio.AbstractEventLoop
1213

1314

1415
_T = _typing.TypeVar("_T")
1516

1617

17-
class Loop(__BaseLoop, __asyncio.AbstractEventLoop): # type: ignore[misc]
18+
class Loop(__BaseLoop, _AbstractEventLoop): # type: ignore[misc]
1819
pass
1920

2021

@@ -100,7 +101,7 @@ async def wrapper():
100101
)
101102

102103

103-
def _cancel_all_tasks(loop: __asyncio.AbstractEventLoop) -> None:
104+
def _cancel_all_tasks(loop: _AbstractEventLoop) -> None:
104105
# Copied from python/cpython
105106

106107
to_cancel = __asyncio.all_tasks(loop)
@@ -197,9 +198,7 @@ def get_event_loop(self) -> Loop:
197198

198199
def set_event_loop(self, loop: Loop) -> None:
199200
"""Set the event loop."""
200-
if loop is not None and not isinstance(
201-
loop, __asyncio.AbstractEventLoop
202-
):
201+
if loop is not None and not isinstance(loop, _AbstractEventLoop):
203202
raise TypeError(
204203
f"loop must be an instance of AbstractEventLoop or None, "
205204
f"not '{type(loop).__name__}'"

0 commit comments

Comments
 (0)