Skip to content

Commit 930a0c6

Browse files
committed
fix HTTPClient using loop instead of _loop
1 parent 3f0783a commit 930a0c6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

discord/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def __init__(
247247
proxy=proxy,
248248
proxy_auth=proxy_auth,
249249
unsync_clock=unsync_clock,
250-
loop=self.loop,
250+
loop=self._loop,
251251
)
252252

253253
self._handlers: dict[str, Callable] = {"ready": self._handle_ready}
@@ -274,7 +274,7 @@ def __init__(
274274
self._tasks = set()
275275

276276
async def __aenter__(self) -> Client:
277-
if self._loop is MISSING:
277+
if self._loop is None:
278278
try:
279279
self._loop = asyncio.get_running_loop()
280280
except RuntimeError:

discord/http.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ def __init__(
175175
loop: asyncio.AbstractEventLoop | None = None,
176176
unsync_clock: bool = True,
177177
) -> None:
178-
self.loop: asyncio.AbstractEventLoop = (
179-
asyncio.get_event_loop() if loop is None else loop
180-
)
178+
self.loop: asyncio.AbstractEventLoop = loop or MISSING
181179
self.connector = connector
182180
self.__session: aiohttp.ClientSession = MISSING # filled in static_login
183181
self._locks: weakref.WeakValueDictionary = weakref.WeakValueDictionary()

0 commit comments

Comments
 (0)