Preserve backward compatibility with old .sign_in() code

This commit is contained in:
Lonami Exo 2017-08-31 10:38:53 +02:00
parent 5f636fdf31
commit bea1b7f526

View File

@ -267,10 +267,10 @@ class TelegramClient(TelegramBareClient):
If the login succeeds, the logged in user is returned.
"""
if phone:
if phone and not code:
return self.send_code_request(phone)
elif code:
if self._phone == None:
if self._phone is None:
raise ValueError(
'Please make sure to call send_code_request first.')