diff --git a/telethon/tl/session.py b/telethon/session.py similarity index 98% rename from telethon/tl/session.py rename to telethon/session.py index bfed1a79..f7170478 100644 --- a/telethon/tl/session.py +++ b/telethon/session.py @@ -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 diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index bee3ecdd..9b756f43 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -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 diff --git a/telethon/tl/__init__.py b/telethon/tl/__init__.py index 403e481a..96c934bb 100644 --- a/telethon/tl/__init__.py +++ b/telethon/tl/__init__.py @@ -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