mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-24 10:23:44 +03:00
parent
39fc5c5fef
commit
2b99ff65c5
|
@ -7,6 +7,7 @@ import platform
|
|||
import time
|
||||
import typing
|
||||
import datetime
|
||||
import pathlib
|
||||
|
||||
from .. import version, helpers, __name__ as __base_name__
|
||||
from ..crypto import rsa
|
||||
|
@ -235,7 +236,7 @@ class TelegramBaseClient(abc.ABC):
|
|||
|
||||
def __init__(
|
||||
self: 'TelegramClient',
|
||||
session: 'typing.Union[str, Session]',
|
||||
session: 'typing.Union[str, pathlib.Path, Session]',
|
||||
api_id: int,
|
||||
api_hash: str,
|
||||
*,
|
||||
|
@ -284,9 +285,9 @@ class TelegramBaseClient(abc.ABC):
|
|||
self._log = _Loggers()
|
||||
|
||||
# Determine what session object we have
|
||||
if isinstance(session, str) or session is None:
|
||||
if isinstance(session, (str, pathlib.Path)) or session is None:
|
||||
try:
|
||||
session = SQLiteSession(session)
|
||||
session = SQLiteSession(str(session))
|
||||
except ImportError:
|
||||
import warnings
|
||||
warnings.warn(
|
||||
|
|
Loading…
Reference in New Issue
Block a user