Skip to content

Commit 9b54ab1

Browse files
committed
Do not enable REDUNDANT_EXPR accidentally.
1 parent 53d894a commit 9b54ab1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypy/checker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@ def accept_loop(
612612
# If necessary, reset the modified options and make up for the postponed error checks:
613613
if warn_unreachable or warn_redundant:
614614
self.options.warn_unreachable = warn_unreachable
615-
self.options.enabled_error_codes.add(codes.REDUNDANT_EXPR)
615+
if warn_redundant:
616+
self.options.enabled_error_codes.add(codes.REDUNDANT_EXPR)
616617
with self.binder.frame_context(can_skip=True, break_frame=2, continue_frame=1):
617618
self.accept(body)
618619

0 commit comments

Comments
 (0)