mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-11 03:56:36 +03:00
Use issubclass
instead of direct class comparison
This commit is contained in:
parent
fef580c24b
commit
43505e0aad
|
@ -30,8 +30,8 @@ class MTProxyIO:
|
|||
def init_header(self, secret, dc_id, packet_codec):
|
||||
# Validate
|
||||
is_dd = (len(secret) == 17) and (secret[0] == 0xDD)
|
||||
is_rand_codec = (
|
||||
packet_codec == RandomizedIntermediatePacketCodec)
|
||||
is_rand_codec = issubclass(
|
||||
packet_codec, RandomizedIntermediatePacketCodec)
|
||||
if is_dd and not is_rand_codec:
|
||||
raise ValueError(
|
||||
"Only RandomizedIntermediate can be used with dd-secrets")
|
||||
|
|
Loading…
Reference in New Issue
Block a user