2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Use getpass instead of input

This commit is contained in:
Dan 2018-06-01 19:27:05 +02:00
parent dacc0173f1
commit b4a2490da2

View File

@ -18,6 +18,7 @@
import base64 import base64
import binascii import binascii
import getpass
import json import json
import logging import logging
import math import math
@ -498,7 +499,7 @@ class Client(Methods, BaseClient):
if self.password is None: if self.password is None:
print("Hint: {}".format(r.hint)) print("Hint: {}".format(r.hint))
self.password = input("Enter password: ") # TODO: Use getpass self.password = getpass.getpass("Enter password: ")
if type(self.password) is str: if type(self.password) is str:
self.password = r.current_salt + self.password.encode() + r.current_salt self.password = r.current_salt + self.password.encode() + r.current_salt