Add warning log to maybe_async

This commit is contained in:
humbertogontijo 2025-07-28 11:45:36 -03:00
parent 41c74f50a7
commit cb347dc01f
2 changed files with 2 additions and 3 deletions

View File

@ -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.

View File

@ -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