File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 3838from mypy import message_registry
3939from mypy .errors import Errors
4040from mypy .options import Options
41+ from mypy .reachability import mark_block_unreachable
4142
4243try :
4344 # pull this into a final variable to make mypyc be quiet about the
@@ -311,7 +312,7 @@ def translate_stmt_list(self,
311312 and min (self .type_ignores ) < self .get_lineno (stmts [0 ])):
312313 self .errors .used_ignored_lines [self .errors .file ].add (min (self .type_ignores ))
313314 block = Block (self .fix_function_overloads (self .translate_stmt_list (stmts )))
314- block . is_unreachable = True
315+ mark_block_unreachable ( block )
315316 return [block ]
316317
317318 res = [] # type: List[Statement]
Original file line number Diff line number Diff line change 4747from mypy .errors import Errors
4848from mypy .fastparse import TypeConverter , parse_type_comment , bytes_to_human_readable_repr
4949from mypy .options import Options
50+ from mypy .reachability import mark_block_unreachable
5051
5152try :
5253 from typed_ast import ast27
@@ -209,7 +210,7 @@ def translate_stmt_list(self,
209210 and min (self .type_ignores ) < self .get_lineno (stmts [0 ])):
210211 self .errors .used_ignored_lines [self .errors .file ].add (min (self .type_ignores ))
211212 block = Block (self .fix_function_overloads (self .translate_stmt_list (stmts )))
212- block . is_unreachable = True
213+ mark_block_unreachable ( block )
213214 return [block ]
214215
215216 res = [] # type: List[Statement]
Original file line number Diff line number Diff line change @@ -242,6 +242,10 @@ IGNORE
242242def f(): ...
243243IGNORE
244244
245+ [case testIgnoreWholeModule5]
246+ # type: ignore
247+ import MISSING
248+
245249[case testDontIgnoreWholeModule1]
246250if True:
247251 # type: ignore
You can’t perform that action at this time.
0 commit comments