Browse Source
Fix aiohttp websocket timeout deprecation warning
pull/10422/head
₳Ⱡ₥Ø₲
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
1 deletions
-
discord/http.py
|
|
|
@ -551,11 +551,16 @@ class HTTPClient: |
|
|
|
self.__session = MISSING |
|
|
|
|
|
|
|
async def ws_connect(self, url: str, *, compress: int = 0) -> aiohttp.ClientWebSocketResponse: |
|
|
|
try: |
|
|
|
timeout: Any = aiohttp.ClientWSTimeout(ws_close=30.0) # pyright: ignore[reportCallIssue] |
|
|
|
except (AttributeError, TypeError): |
|
|
|
timeout = 30.0 |
|
|
|
|
|
|
|
kwargs = { |
|
|
|
'proxy_auth': self.proxy_auth, |
|
|
|
'proxy': self.proxy, |
|
|
|
'max_msg_size': 0, |
|
|
|
'timeout': 30.0, |
|
|
|
'timeout': timeout, |
|
|
|
'autoclose': False, |
|
|
|
'headers': { |
|
|
|
'User-Agent': self.user_agent, |
|
|
|
|