Skip to content

Commit cb1ebcd

Browse files
committed
Move comment about error suppression to the right place
1 parent 7147769 commit cb1ebcd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mypy/checkexpr.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,10 +2794,6 @@ def check_boolean_op(self, e: OpExpr, context: Context) -> Type:
27942794
if left_map is None:
27952795
self.msg.redundant_left_operand(e.op, e.left)
27962796

2797-
# If right_map is None then we know mypy considers the right branch
2798-
# to be unreachable and therefore any errors found in the right branch
2799-
# should be suppressed.
2800-
#
28012797
# Note that we perform these checks *before* we take into account
28022798
# the analysis from the semanal phase below. We assume that nodes
28032799
# marked as unreachable during semantic analysis were done so intentionally.
@@ -2811,6 +2807,9 @@ def check_boolean_op(self, e: OpExpr, context: Context) -> Type:
28112807
elif e.right_always:
28122808
left_map = None
28132809

2810+
# If right_map is None then we know mypy considers the right branch
2811+
# to be unreachable and therefore any errors found in the right branch
2812+
# should be suppressed.
28142813
with (self.msg.disable_errors() if right_map is None else nullcontext()):
28152814
right_type = self.analyze_cond_branch(right_map, e.right, left_type)
28162815

0 commit comments

Comments
 (0)