Fix crashing when an unhandled event occurs.

This commit is contained in:
Rapptz 2016-03-06 16:26:58 -05:00
parent 80587fc1e9
commit 6694df268c

View File

@ -370,10 +370,10 @@ class Client:
func = getattr(self.connection, parser)
except AttributeError:
log.info('Unhandled event {}'.format(event))
result = func(data)
if asyncio.iscoroutine(result):
utils.create_task(result, loop=self.loop)
else:
result = func(data)
if asyncio.iscoroutine(result):
utils.create_task(result, loop=self.loop)
@asyncio.coroutine
def _make_websocket(self, initial=True):