File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 38
38
from mypy import message_registry
39
39
from mypy .errors import Errors
40
40
from mypy .options import Options
41
+ from mypy .reachability import mark_block_unreachable
41
42
42
43
try :
43
44
# pull this into a final variable to make mypyc be quiet about the
@@ -311,7 +312,7 @@ def translate_stmt_list(self,
311
312
and min (self .type_ignores ) < self .get_lineno (stmts [0 ])):
312
313
self .errors .used_ignored_lines [self .errors .file ].add (min (self .type_ignores ))
313
314
block = Block (self .fix_function_overloads (self .translate_stmt_list (stmts )))
314
- block . is_unreachable = True
315
+ mark_block_unreachable ( block )
315
316
return [block ]
316
317
317
318
res = [] # type: List[Statement]
Original file line number Diff line number Diff line change 47
47
from mypy .errors import Errors
48
48
from mypy .fastparse import TypeConverter , parse_type_comment , bytes_to_human_readable_repr
49
49
from mypy .options import Options
50
+ from mypy .reachability import mark_block_unreachable
50
51
51
52
try :
52
53
from typed_ast import ast27
@@ -209,7 +210,7 @@ def translate_stmt_list(self,
209
210
and min (self .type_ignores ) < self .get_lineno (stmts [0 ])):
210
211
self .errors .used_ignored_lines [self .errors .file ].add (min (self .type_ignores ))
211
212
block = Block (self .fix_function_overloads (self .translate_stmt_list (stmts )))
212
- block . is_unreachable = True
213
+ mark_block_unreachable ( block )
213
214
return [block ]
214
215
215
216
res = [] # type: List[Statement]
Original file line number Diff line number Diff line change @@ -242,6 +242,10 @@ IGNORE
242
242
def f(): ...
243
243
IGNORE
244
244
245
+ [case testIgnoreWholeModule5]
246
+ # type: ignore
247
+ import MISSING
248
+
245
249
[case testDontIgnoreWholeModule1]
246
250
if True:
247
251
# type: ignore
You can’t perform that action at this time.
0 commit comments