Skip to content

Commit

Permalink
hotfix: run_body.__call__.__annotations__
Browse files Browse the repository at this point in the history
  • Loading branch information
Chenwe_i_lin committed Mar 3, 2020
1 parent a23d161 commit add52df
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mirai/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,18 @@ async def main_entrance(self, run_body, event_context, queue):
callable_target = run_body['func']
for depend in run_body['dependencies']:
await self.main_entrance(
{"func": depend.func.__call__, "middlewares": depend.middlewares},
{
"func": depend.func if not inspect.isclass(depend.func) else\
depend.func.__call__ if hasattr(depend.func, "__call__") else\
raiser(TypeError("must be callable.")),
"middlewares": depend.middlewares
},
event_context, queue
)
else:
callable_target = run_body.__call__
callable_target = run_body if not inspect.isclass(run_body) else\
run_body.__call__ if hasattr(run_body, "__call__") else\
raiser(TypeError("must be callable."))

translated_mapping = {
**(await self.argument_compiler(
Expand Down

0 comments on commit add52df

Please sign in to comment.