Skip to content

Commit e51a0a1

Browse files
fixup! Visit child nodes of TryStar
1 parent 6515118 commit e51a0a1

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

astroid/rebuilder.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,13 +1830,8 @@ def visit_trystar(self, node: ast.TryStar, parent: NodeNG) -> nodes.TryStar:
18301830
end_col_offset=getattr(node, "end_col_offset", None),
18311831
parent=parent,
18321832
)
1833-
body: list[NodeNG | nodes.TryExcept]
1834-
if node.handlers:
1835-
body = [self.visit_tryexcept(node, newnode)]
1836-
else:
1837-
body = [self.visit(child, newnode) for child in node.body]
18381833
newnode.postinit(
1839-
body=body,
1834+
body=[self.visit_tryexcept(node, newnode)],
18401835
handlers=[self.visit(n, newnode) for n in node.handlers],
18411836
orelse=[self.visit(n, newnode) for n in node.orelse],
18421837
finalbody=[self.visit(n, newnode) for n in node.finalbody],

0 commit comments

Comments
 (0)