Skip to content

Commit a5eb480

Browse files
committed
Fixed more failing tests after merge (Caused by python#10685)
1 parent f2e12f8 commit a5eb480

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

mypy/renaming.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,14 @@ def visit_assignment_stmt(self, s: AssignmentStmt) -> None:
162162

163163
def visit_match_stmt(self, s: MatchStmt) -> None:
164164
for i in range(len(s.patterns)):
165-
self.enter_block()
166-
s.patterns[i].accept(self)
167-
guard = s.guards[i]
168-
if guard is not None:
169-
guard.accept(self)
170-
# We already entered a block, so visit this block's statements directly
171-
for stmt in s.bodies[i].body:
172-
stmt.accept(self)
173-
self.leave_block()
165+
with self.enter_block():
166+
s.patterns[i].accept(self)
167+
guard = s.guards[i]
168+
if guard is not None:
169+
guard.accept(self)
170+
# We already entered a block, so visit this block's statements directly
171+
for stmt in s.bodies[i].body:
172+
stmt.accept(self)
174173

175174
def visit_capture_pattern(self, p: AsPattern) -> None:
176175
if p.name is not None:

0 commit comments

Comments
 (0)