From ee70df030e9a07304821b31b0fcb9fa0ddb681be Mon Sep 17 00:00:00 2001 From: hsfzxjy Date: Sun, 7 Feb 2021 17:58:00 +0800 Subject: [PATCH] Fix bug: 'finally_' should assert no head --- lambdex/compiler/rules.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lambdex/compiler/rules.py b/lambdex/compiler/rules.py index 3019bc2..e607193 100644 --- a/lambdex/compiler/rules.py +++ b/lambdex/compiler/rules.py @@ -322,6 +322,7 @@ def r_try(node: ast.Subscript, ctx: Context, clauses: list): orelse_body.extend(_compile_stmts(ctx, clause.body)) elif clause.name == 'finally_': ctx.assert_(not final_body, 'unexpected_ "finally_"', node) + ctx.assert_no_head(clause) final_body.extend(_compile_stmts(ctx, clause.body)) ctx.assert_(