From 1794acdfece98c8441805175aa2ff35de4e0de2d Mon Sep 17 00:00:00 2001 From: MeytiGHG Date: Mon, 7 Aug 2017 03:24:23 +0430 Subject: [PATCH] Check for isinstance(x, JsonSession) instead crashing during transition --- telethon/telegram_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 703f3b3f..bae29e49 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -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.')