Skip to content

Commit 2831024

Browse files
committed
Update _event.py
1 parent 9ff6732 commit 2831024

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

dank_mids/helpers/_event.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import asyncio
2-
from typing import TYPE_CHECKING, Final, final
3-
from weakref import ProxyType, proxy
2+
import weakref
3+
from typing import Final, final
44

55
import a_sync
66

77
from dank_mids.types import T
88

9-
if TYPE_CHECKING:
10-
from dank_mids._requests import _RequestBase, _Response
11-
129

1310
_get_running_loop: Final = asyncio.get_running_loop
1411
_super_init: Final = a_sync.Event.__init__
@@ -17,14 +14,14 @@
1714

1815
@final
1916
class RequestEvent(a_sync.Event):
20-
_owner: Final[ProxyType[T]]
17+
_owner: Final[weakref.ProxyType[T]]
2118
_owner_in_repr: Final[bool]
2219

2320
def __init__(self, owner: T) -> None:
2421
_super_init(self, debug_daemon_interval=300)
2522
if self.debug_logs_enabled:
2623
self._owner_in_repr = True
27-
self._owner = proxy(owner)
24+
self._owner = weakref.proxy(owner)
2825
else:
2926
self._owner_in_repr = False
3027

0 commit comments

Comments
 (0)