From: Pablo Galindo Date: Mon, 26 Aug 2019 15:27:31 +0000 (+0100) Subject: [3.8] bpo-37947: Adjust correctly the recursion level in symtable for named expressio... X-Git-Tag: v3.8.0b4~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3769425abd8da9a59b9645baf90ef49b9c69c140;p=thirdparty%2FPython%2Fcpython.git [3.8] bpo-37947: Adjust correctly the recursion level in symtable for named expressions (GH-15499) (GH-15515) (cherry picked from commit 0e4ea16336685cf3fa353d8c54af59b45b2d5c33) Co-authored-by: Pablo Galindo --- diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-08-26-04-09-57.bpo-37947.mzAQtB.rst b/Misc/NEWS.d/next/Core and Builtins/2019-08-26-04-09-57.bpo-37947.mzAQtB.rst new file mode 100644 index 000000000000..2b3b72367030 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-08-26-04-09-57.bpo-37947.mzAQtB.rst @@ -0,0 +1,2 @@ +Adjust correctly the recursion level in the symtable generation for named +expressions. Patch by Pablo Galindo. diff --git a/Python/symtable.c b/Python/symtable.c index e48baa808d41..18ea57690b5d 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);