mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 12:10:21 +03:00
Add warning log to maybe_async
This commit is contained in:
parent
41c74f50a7
commit
cb347dc01f
|
@ -320,9 +320,6 @@ class TelegramBaseClient(abc.ABC):
|
|||
self.api_id = int(api_id)
|
||||
self.api_hash = api_hash
|
||||
|
||||
if inspect.iscoroutinefunction(self.session.process_entities):
|
||||
self._log[__name__].warning('Using async sessions support is an experimental feature')
|
||||
|
||||
# Current proxy implementation requires `sock_connect`, and some
|
||||
# event loops lack this method. If the current loop is missing it,
|
||||
# bail out early and suggest an alternative.
|
||||
|
|
|
@ -14,6 +14,7 @@ import os
|
|||
import pathlib
|
||||
import re
|
||||
import struct
|
||||
import warnings
|
||||
from collections import namedtuple
|
||||
from mimetypes import guess_extension
|
||||
from types import GeneratorType
|
||||
|
@ -1562,5 +1563,6 @@ def _photo_size_byte_count(size):
|
|||
async def maybe_async(coro):
|
||||
result = coro
|
||||
if inspect.isawaitable(result):
|
||||
warnings.warn('Using async sessions support is an experimental feature')
|
||||
result = await result
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue
Block a user