Skip to content

Commit

Permalink
except* too
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Oct 21, 2023
1 parent 1e121f8 commit 72fd4d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Lib/test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,15 +1289,15 @@ def test_global_declaration_in_except_used_in_else(self):
def f():
try:
pass
except:
%s Exception:
global a
else:
print(a)
""")

g, l = {'a': 5}, {}
exec(code, g, l);
compile(code, "<test>", "exec")
for kw in ("except", "except*"):
exec(code % kw, g, l);


@requires_debug_ranges()
Expand Down
2 changes: 1 addition & 1 deletion Python/symtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,8 +1819,8 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
break;
case TryStar_kind:
VISIT_SEQ(st, stmt, s->v.TryStar.body);
VISIT_SEQ(st, stmt, s->v.TryStar.orelse);
VISIT_SEQ(st, excepthandler, s->v.TryStar.handlers);
VISIT_SEQ(st, stmt, s->v.TryStar.orelse);
VISIT_SEQ(st, stmt, s->v.TryStar.finalbody);
break;
case Assert_kind:
Expand Down

0 comments on commit 72fd4d1

Please sign in to comment.