Fix all deprecation warnings for 3.8
This commit is contained in:
@@ -101,8 +101,8 @@ class VoiceClient:
|
||||
self._connected = threading.Event()
|
||||
|
||||
self._handshaking = False
|
||||
self._handshake_check = asyncio.Lock(loop=self.loop)
|
||||
self._handshake_complete = asyncio.Event(loop=self.loop)
|
||||
self._handshake_check = asyncio.Lock()
|
||||
self._handshake_complete = asyncio.Event()
|
||||
|
||||
self.mode = None
|
||||
self._connections = 0
|
||||
@@ -149,7 +149,7 @@ class VoiceClient:
|
||||
await ws.voice_state(guild_id, channel_id)
|
||||
|
||||
try:
|
||||
await asyncio.wait_for(self._handshake_complete.wait(), timeout=self.timeout, loop=self.loop)
|
||||
await asyncio.wait_for(self._handshake_complete.wait(), timeout=self.timeout)
|
||||
except asyncio.TimeoutError:
|
||||
await self.terminate_handshake(remove=True)
|
||||
raise
|
||||
@@ -225,7 +225,7 @@ class VoiceClient:
|
||||
except (ConnectionClosed, asyncio.TimeoutError):
|
||||
if reconnect and _tries < 5:
|
||||
log.exception('Failed to connect to voice... Retrying...')
|
||||
await asyncio.sleep(1 + _tries * 2.0, loop=self.loop)
|
||||
await asyncio.sleep(1 + _tries * 2.0)
|
||||
await self.terminate_handshake()
|
||||
await self.connect(reconnect=reconnect, _tries=_tries + 1)
|
||||
else:
|
||||
@@ -257,7 +257,7 @@ class VoiceClient:
|
||||
retry = backoff.delay()
|
||||
log.exception('Disconnected from voice... Reconnecting in %.2fs.', retry)
|
||||
self._connected.clear()
|
||||
await asyncio.sleep(retry, loop=self.loop)
|
||||
await asyncio.sleep(retry)
|
||||
await self.terminate_handshake()
|
||||
try:
|
||||
await self.connect(reconnect=True)
|
||||
|
||||
Reference in New Issue
Block a user