Add on_disconnect event.

I assume this is where it has to be. Fix #1937
This commit is contained in:
Rapptz
2019-03-18 05:29:38 -04:00
parent f43690bde8
commit 963cf4b34e
2 changed files with 9 additions and 0 deletions

View File

@ -409,6 +409,7 @@ class Client:
websockets.InvalidHandshake,
websockets.WebSocketProtocolError) as exc:
self.dispatch('disconnect')
if not reconnect:
await self.close()
if isinstance(exc, ConnectionClosed) and exc.code == 1000: