Skip to content

Commit b3c7b3b

Browse files
committed
bring back the hacky bit
1 parent a107192 commit b3c7b3b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

custom_components/pyscript/eval.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,17 @@ async def eval_decorators(self, ast_ctx):
535535
else:
536536
dec_funcs.append(await ast_ctx.aeval(dec))
537537

538+
def make_dec_call(func):
539+
async def dec_call(*args_tuple, **kwargs):
540+
args = list(args_tuple)
541+
if len(args) > 0 and isinstance(args[0], AstEval):
542+
args.pop(0)
543+
return await func(ast_ctx, *args, **kwargs)
544+
545+
return dec_call
546+
538547
for func in reversed(dec_funcs):
539-
self.call = await ast_ctx.call_func(func, None, self.call)
548+
self.call = await ast_ctx.call_func(func, None, make_dec_call(self.call))
540549

541550
ast_ctx.code_str, ast_ctx.code_list = code_str, code_list
542551

0 commit comments

Comments
 (0)