Don't overload `func` arg

self_register
Tyler Goodlet 2018-09-21 09:46:01 -04:00
parent 034146f2b1
commit 109b5971ed
1 changed files with 2 additions and 2 deletions

View File

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