diff options
author | Gregory P. Smith <greg@krypto.org> | 2011-06-04 23:05:19 -0700 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2011-06-04 23:05:19 -0700 |
commit | d64b2bae9b4d1b761cd16f75e3fe3e9c19533b3e (patch) | |
tree | cac5baf3e31b67e39cb9b69d982958cc9419db06 /Python/symtable.c | |
parent | b6471db8a76416b2eb49fe9b02c6f9f9a6502b4d (diff) | |
parent | e13e662244b4915e933eb2c84bc50705f99f5c4a (diff) | |
download | cpython-git-d64b2bae9b4d1b761cd16f75e3fe3e9c19533b3e.tar.gz |
merge heads.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 8040665b58..e31a2ebb39 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -185,6 +185,7 @@ static int symtable_visit_params(struct symtable *st, asdl_seq *args); static int symtable_visit_argannotations(struct symtable *st, asdl_seq *args); static int symtable_implicit_arg(struct symtable *st, int pos); static int symtable_visit_annotations(struct symtable *st, stmt_ty s); +static int symtable_visit_withitem(struct symtable *st, withitem_ty item); static identifier top = NULL, lambda = NULL, genexpr = NULL, @@ -1210,14 +1211,11 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) } } break; - case TryExcept_kind: - VISIT_SEQ(st, stmt, s->v.TryExcept.body); - VISIT_SEQ(st, stmt, s->v.TryExcept.orelse); - VISIT_SEQ(st, excepthandler, s->v.TryExcept.handlers); - break; - case TryFinally_kind: - VISIT_SEQ(st, stmt, s->v.TryFinally.body); - VISIT_SEQ(st, stmt, s->v.TryFinally.finalbody); + case Try_kind: + VISIT_SEQ(st, stmt, s->v.Try.body); + VISIT_SEQ(st, stmt, s->v.Try.orelse); + VISIT_SEQ(st, excepthandler, s->v.Try.handlers); + VISIT_SEQ(st, stmt, s->v.Try.finalbody); break; case Assert_kind: VISIT(st, expr, s->v.Assert.test); @@ -1305,10 +1303,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) /* nothing to do here */ break; case With_kind: - VISIT(st, expr, s->v.With.context_expr); - if (s->v.With.optional_vars) { - VISIT(st, expr, s->v.With.optional_vars); - } + VISIT_SEQ(st, withitem, s->v.With.items); VISIT_SEQ(st, stmt, s->v.With.body); break; } @@ -1540,6 +1535,16 @@ symtable_visit_excepthandler(struct symtable *st, excepthandler_ty eh) return 1; } +static int +symtable_visit_withitem(struct symtable *st, withitem_ty item) +{ + VISIT(st, expr, item->context_expr); + if (item->optional_vars) { + VISIT(st, expr, item->optional_vars); + } + return 1; +} + static int symtable_visit_alias(struct symtable *st, alias_ty a) |