From 567f34132194ef45e90aa8b440a5c89bebc84f2c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 23 Jan 2019 11:18:37 -0800 Subject: [PATCH] Fix assert in ast_for_suite() -- n can be a func_body_suite too now --- Python/ast.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/ast.c b/Python/ast.c index b91c2bbc0462..6aa46e34014a 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3674,7 +3674,9 @@ ast_for_suite(struct compiling *c, const node *n) int i, total, num, end, pos = 0; node *ch; - REQ(n, suite); + if (TYPE(n) != func_body_suite) { + REQ(n, suite); + } total = num_stmts(n); seq = _Py_asdl_seq_new(total, c->c_arena); -- 2.47.3