Skip to content

Commit

Permalink
bpo-37947: Adjust correctly the recursion level in symtable for named…
Browse files Browse the repository at this point in the history
… expressions (pythonGH-15499)
  • Loading branch information
pablogsal authored and DinoV committed Jan 14, 2020
1 parent 574ef2a commit a17ec91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Adjust correctly the recursion level in the symtable generation for named
expressions. Patch by Pablo Galindo.
4 changes: 3 additions & 1 deletion Python/symtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit a17ec91

Please sign in to comment.