File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -595,11 +595,9 @@ def accept_loop(
595595
596596 # Disable error types that we cannot safely identify in intermediate iteration steps:
597597 warn_unreachable = self .options .warn_unreachable
598- if warn_unreachable :
599- self .options .warn_unreachable = False
600598 warn_redundant = codes .REDUNDANT_EXPR in self .options .enabled_error_codes
601- if warn_redundant :
602- self .options .enabled_error_codes .remove (codes .REDUNDANT_EXPR )
599+ self . options . warn_unreachable = False
600+ self .options .enabled_error_codes .discard (codes .REDUNDANT_EXPR )
603601
604602 while True :
605603 with self .binder .frame_context (can_skip = True , break_frame = 2 , continue_frame = 1 ):
@@ -610,10 +608,10 @@ def accept_loop(
610608 partials_old = partials_new
611609
612610 # If necessary, reset the modified options and make up for the postponed error checks:
611+ self .options .warn_unreachable = warn_unreachable
612+ if warn_redundant :
613+ self .options .enabled_error_codes .add (codes .REDUNDANT_EXPR )
613614 if warn_unreachable or warn_redundant :
614- self .options .warn_unreachable = warn_unreachable
615- if warn_redundant :
616- self .options .enabled_error_codes .add (codes .REDUNDANT_EXPR )
617615 with self .binder .frame_context (can_skip = True , break_frame = 2 , continue_frame = 1 ):
618616 self .accept (body )
619617
You can’t perform that action at this time.
0 commit comments