mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-07 05:30:20 +03:00
Spaces
This commit is contained in:
parent
04f9ed557a
commit
c6ceff5533
|
@ -979,13 +979,13 @@ class AsyncClassWrapper:
|
||||||
|
|
||||||
def __getattr__(self, item):
|
def __getattr__(self, item):
|
||||||
w = getattr(self.wrapped, item)
|
w = getattr(self.wrapped, item)
|
||||||
async def wrapper(*args,**kwargs):
|
async def wrapper(*args, **kwargs):
|
||||||
val = w(*args, **kwargs)
|
val = w(*args, **kwargs)
|
||||||
return await val if inspect.isawaitable(val) else val
|
return await val if inspect.isawaitable(val) else val
|
||||||
|
|
||||||
if inspect.isfunction(w) or inspect.ismethod(w):
|
if callable(w):
|
||||||
return wrapper
|
return wrapper
|
||||||
elif isinstance(w,property):
|
elif isinstance(w, property):
|
||||||
return w.fget(self.wrapped)
|
return w.fget(self.wrapped)
|
||||||
else:
|
else:
|
||||||
return w
|
return w
|
||||||
|
|
Loading…
Reference in New Issue
Block a user