Don't overload `func` arg
parent
034146f2b1
commit
109b5971ed
|
@ -217,11 +217,11 @@ class LocalPortal:
|
|||
) -> None:
|
||||
self.actor = actor
|
||||
|
||||
async def run(self, ns: str, func: str, **kwargs) -> Any:
|
||||
async def run(self, ns: str, func_name: str, **kwargs) -> Any:
|
||||
"""Run a requested function locally and return it's result.
|
||||
"""
|
||||
obj = self.actor if ns == 'self' else importlib.import_module(ns)
|
||||
func = getattr(obj, func)
|
||||
func = getattr(obj, func_name)
|
||||
if inspect.iscoroutinefunction(func):
|
||||
return await func(**kwargs)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue