Skip to content

Commit ea3281b

Browse files
committed
Raise directly when not checking a boolean expression
1 parent 8aa3581 commit ea3281b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pyrogram/crypto/mtproto.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,21 @@ def unpack(
106106
if stored_msg_ids:
107107
# Ignored message: msg_id is lower than all of the stored values
108108
if message.msg_id < stored_msg_ids[0]:
109-
SecurityCheckMismatch.check(False)
109+
raise SecurityCheckMismatch
110110

111111
# Ignored message: msg_id is equal to any of the stored values
112112
if message.msg_id in stored_msg_ids:
113-
SecurityCheckMismatch.check(False)
113+
raise SecurityCheckMismatch
114114

115115
time_diff = (message.msg_id - MsgId()) / 2 ** 32
116116

117117
# Ignored message: msg_id belongs over 30 seconds in the future
118118
if time_diff > 30:
119-
SecurityCheckMismatch.check(False)
119+
raise SecurityCheckMismatch
120120

121121
# Ignored message: msg_id belongs over 300 seconds in the past
122122
if time_diff < -300:
123-
SecurityCheckMismatch.check(False)
123+
raise SecurityCheckMismatch
124124

125125
bisect.insort(stored_msg_ids, message.msg_id)
126126

0 commit comments

Comments
 (0)