2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

Move GetPassword request outside the loop

This commit is contained in:
Dan 2018-01-24 18:35:17 +01:00
parent f65d369fd1
commit a662c1734f

View File

@ -290,10 +290,10 @@ class Client:
self.phone_code = None
except SessionPasswordNeeded as e:
print(e.MESSAGE)
r = self.send(functions.account.GetPassword())
while True:
try:
r = self.send(functions.account.GetPassword())
if self.password is None:
print("Hint: {}".format(r.hint))