Support async def in sessions (#1013)

This commit is contained in:
josephbiko
2018-10-05 20:25:49 +02:00
committed by Lonami
parent 653f3c043d
commit 3dd8b7c6d1
10 changed files with 49 additions and 28 deletions

View File

@@ -21,6 +21,7 @@ from ..tl.types import (
MsgNewDetailedInfo, NewSessionCreated, MsgDetailedInfo, MsgsStateReq,
MsgsStateInfo, MsgsAllInfo, MsgResendReq, upload
)
from ..utils import AsyncClassWrapper
__log__ = logging.getLogger(__name__)
@@ -213,7 +214,7 @@ class MTProtoSender:
await authenticator.do_authentication(plain)
if self._auth_key_callback:
self._auth_key_callback(state.auth_key)
await self._auth_key_callback(state.auth_key)
break
except (SecurityError, AssertionError) as e: