From 0e4ea16336685cf3fa353d8c54af59b45b2d5c33 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Mon, 26 Aug 2019 15:52:25 +0100 Subject: bpo-37947: Adjust correctly the recursion level in symtable for named expressions (GH-15499) --- Python/symtable.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Python/symtable.c') diff --git a/Python/symtable.c b/Python/symtable.c index e48baa808d..18ea57690b 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1508,6 +1508,7 @@ symtable_handle_namedexpr(struct symtable *st, expr_ty e) } VISIT(st, expr, e->v.NamedExpr.value); VISIT(st, expr, e->v.NamedExpr.target); + VISIT_QUIT(st, 1); } static int @@ -1520,7 +1521,8 @@ symtable_visit_expr(struct symtable *st, expr_ty e) } switch (e->kind) { case NamedExpr_kind: - symtable_handle_namedexpr(st, e); + if(!symtable_handle_namedexpr(st, e)) + VISIT_QUIT(st, 0); break; case BoolOp_kind: VISIT_SEQ(st, expr, e->v.BoolOp.values); -- cgit v1.2.1