mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Check for isinstance(x, JsonSession) instead crashing during transition
This commit is contained in:
parent
83c346ccc5
commit
1794acdfec
|
@ -87,7 +87,7 @@ class TelegramClient(TelegramBareClient):
|
|||
# TODO JsonSession until migration is complete (by v1.0)
|
||||
if isinstance(session, str) or session is None:
|
||||
session = JsonSession.try_load_or_create_new(session)
|
||||
elif not isinstance(session, Session):
|
||||
elif not isinstance(session, Session) and not isinstance(session, JsonSession):
|
||||
raise ValueError(
|
||||
'The given session must be a str or a Session instance.')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user