File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -476,11 +476,14 @@ def check_first_pass(self) -> None:
476476 if self .binder .is_unreachable ():
477477 if not self .should_report_unreachable_issues ():
478478 break
479- if not self .is_noop_for_reachability (d ):
479+ if self .is_noop_for_reachability (d ):
480+ if not isinstance (d , ExpressionStmt ) or not isinstance (
481+ d .expr , CallExpr
482+ ):
483+ self .accept (d )
484+ else :
480485 self .msg .unreachable_statement (d )
481486 break
482- else :
483- self .accept (d )
484487 else :
485488 self .accept (d )
486489
@@ -2950,11 +2953,12 @@ def visit_block(self, b: Block) -> None:
29502953 if self .binder .is_unreachable ():
29512954 if not self .should_report_unreachable_issues ():
29522955 break
2953- if not self .is_noop_for_reachability (s ):
2956+ if self .is_noop_for_reachability (s ):
2957+ if not isinstance (s , ExpressionStmt ) or not isinstance (s .expr , CallExpr ):
2958+ self .accept (s )
2959+ else :
29542960 self .msg .unreachable_statement (s )
29552961 break
2956- else :
2957- self .accept (s )
29582962 else :
29592963 self .accept (s )
29602964
You can’t perform that action at this time.
0 commit comments