mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Raise ImportError and not ValueError when sqlite3 is missing
Excepting ValueError when creating the SQLiteSession could hide other errors (e.g. using a newer session file on an older version of the library). Instead, the original error is raised, as if sqlite3 was being imported within its __init__ method.
This commit is contained in:
@@ -202,7 +202,7 @@ class TelegramBaseClient(abc.ABC):
|
||||
if isinstance(session, str) or session is None:
|
||||
try:
|
||||
session = SQLiteSession(session)
|
||||
except ValueError:
|
||||
except ImportError:
|
||||
import warnings
|
||||
warnings.warn(
|
||||
'The sqlite3 module is not available under this '
|
||||
|
Reference in New Issue
Block a user