]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix assert in ast_for_suite() -- n can be a func_body_suite too now
authorGuido van Rossum <guido@python.org>
Wed, 23 Jan 2019 19:18:37 +0000 (11:18 -0800)
committerGuido van Rossum <guido@python.org>
Wed, 23 Jan 2019 19:18:37 +0000 (11:18 -0800)
Python/ast.c

index b91c2bbc0462d9b502aac56b65314297023de6ca..6aa46e34014a9fa9da5b0cdec5dccd97b90b0c37 100644 (file)
@@ -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);