summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-08-26 15:27:31 (GMT)
committerGitHub <noreply@github.com>2019-08-26 15:27:31 (GMT)
commit3769425abd8da9a59b9645baf90ef49b9c69c140 (patch)
tree67bc28f8314db9ded02e4345cb0ba26829e964c2 /Python
parent69d22b8fee442c12829a1032a72489c8133de271 (diff)
downloadcpython-3769425abd8da9a59b9645baf90ef49b9c69c140.zip
cpython-3769425abd8da9a59b9645baf90ef49b9c69c140.tar.gz
cpython-3769425abd8da9a59b9645baf90ef49b9c69c140.tar.bz2
[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 <Pablogsal@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/symtable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index e48baa8..18ea576 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);