mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 19:03:46 +03:00
Fix cyclic imports on Python 3.4 by moving Session one level up
This commit is contained in:
parent
519c113b58
commit
4d4e81e609
|
@ -9,9 +9,10 @@ from enum import Enum
|
|||
from os.path import isfile as file_exists
|
||||
from threading import Lock
|
||||
|
||||
from .. import utils
|
||||
from ..tl import TLObject
|
||||
from ..tl.types import (
|
||||
from . import utils
|
||||
from .crypto import AuthKey
|
||||
from .tl import TLObject
|
||||
from .tl.types import (
|
||||
PeerUser, PeerChat, PeerChannel,
|
||||
InputPeerUser, InputPeerChat, InputPeerChannel,
|
||||
InputPhoto, InputDocument
|
||||
|
@ -118,7 +119,6 @@ class Session:
|
|||
tuple_ = c.fetchone()
|
||||
if tuple_:
|
||||
self._dc_id, self._server_address, self._port, key, = tuple_
|
||||
from ..crypto import AuthKey
|
||||
self._auth_key = AuthKey(data=key)
|
||||
|
||||
c.close()
|
||||
|
@ -173,7 +173,6 @@ class Session:
|
|||
self._server_address = \
|
||||
data.get('server_address', self._server_address)
|
||||
|
||||
from ..crypto import AuthKey
|
||||
if data.get('auth_key_data', None) is not None:
|
||||
key = b64decode(data['auth_key_data'])
|
||||
self._auth_key = AuthKey(data=key)
|
||||
|
@ -228,7 +227,6 @@ class Session:
|
|||
c.execute('select auth_key from sessions')
|
||||
tuple_ = c.fetchone()
|
||||
if tuple_:
|
||||
from ..crypto import AuthKey
|
||||
self._auth_key = AuthKey(data=tuple_[0])
|
||||
else:
|
||||
self._auth_key = None
|
|
@ -15,7 +15,8 @@ from .errors import (
|
|||
PhoneMigrateError, NetworkMigrateError, UserMigrateError
|
||||
)
|
||||
from .network import authenticator, MtProtoSender, Connection, ConnectionMode
|
||||
from .tl import TLObject, Session
|
||||
from .session import Session
|
||||
from .tl import TLObject
|
||||
from .tl.all_tlobjects import LAYER
|
||||
from .tl.functions import (
|
||||
InitConnectionRequest, InvokeWithLayerRequest, PingRequest
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from .tlobject import TLObject
|
||||
from .session import Session
|
||||
from .gzip_packed import GzipPacked
|
||||
from .tl_message import TLMessage
|
||||
from .message_container import MessageContainer
|
||||
|
|
Loading…
Reference in New Issue
Block a user