diff --git a/pyrogram/client.py b/pyrogram/client.py index b6f95bb79..3596ab7d6 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -1002,7 +1002,7 @@ def load_plugins(self): self.name, type(handler).__name__, name, group, module_path)) count += 1 - except Exception: + except AttributeError: pass else: for path, handlers in include: diff --git a/pyrogram/crypto/prime.py b/pyrogram/crypto/prime.py index e919e22ce..90f9c18ca 100644 --- a/pyrogram/crypto/prime.py +++ b/pyrogram/crypto/prime.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from random import randint +from secrets import randbelow CURRENT_DH_PRIME = int( "C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F" @@ -47,7 +47,7 @@ def decompose(pq: int) -> int: if pq % 2 == 0: return 2 - y, c, m = randint(1, pq - 1), randint(1, pq - 1), randint(1, pq - 1) + y, c, m = randbelow(pq - 1) + 1, randbelow(pq - 1) + 1, randbelow(pq - 1) + 1 g = r = q = 1 x = ys = 0