From 84b016cf1c5384385db09e20cd034e6b9bbd131e Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 8 Feb 2022 10:02:59 +0100 Subject: [PATCH] Make more TLObject methods private Even though raw API is somewhat necessary at times, these methods should remain implementation details. --- telethon/_client/users.py | 2 +- telethon/_crypto/rsa.py | 4 ++-- telethon/_misc/binaryreader.py | 2 +- telethon/_misc/tlobject.py | 12 ++++++------ telethon/_network/mtprotosender.py | 2 +- telethon/types/_core/gzippacked.py | 4 ++-- telethon/types/_core/messagecontainer.py | 2 +- telethon/types/_core/rpcresult.py | 6 +++--- telethon_generator/generators/tlobject.py | 14 +++++++------- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/telethon/_client/users.py b/telethon/_client/users.py index b44564e1..d47fab67 100644 --- a/telethon/_client/users.py +++ b/telethon/_client/users.py @@ -40,7 +40,7 @@ async def _call(self: 'TelegramClient', sender, request, ordered=False, flood_sl for r in requests: if not isinstance(r, _tl.TLRequest): raise _NOT_A_REQUEST() - r = await r.resolve(self, utils) + r = await r._resolve(self, utils) # Avoid making the request if it's already in a flood wait if r.CONSTRUCTOR_ID in self._flood_waited_requests: diff --git a/telethon/_crypto/rsa.py b/telethon/_crypto/rsa.py index eca09743..fcfaca48 100644 --- a/telethon/_crypto/rsa.py +++ b/telethon/_crypto/rsa.py @@ -41,8 +41,8 @@ def _compute_fingerprint(key): :param key: the Crypto.RSA key. :return: its 8-bytes-long fingerprint. """ - n = tlobject.TLObject.serialize_bytes(get_byte_array(key.n)) - e = tlobject.TLObject.serialize_bytes(get_byte_array(key.e)) + n = tlobject.TLObject._serialize_bytes(get_byte_array(key.n)) + e = tlobject.TLObject._serialize_bytes(get_byte_array(key.e)) # Telegram uses the last 8 bytes as the fingerprint return struct.unpack('