Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/fastparse2.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def visit_Module(self, mod: ast27.Module) -> MypyFile:
self.type_ignores[ti.lineno] = parsed
else:
self.fail(INVALID_TYPE_IGNORE, ti.lineno, -1)
body = self.fix_function_overloads(self.translate_stmt_list(mod.body))
body = self.fix_function_overloads(self.translate_stmt_list(mod.body, module=True))
return MypyFile(body,
self.imports,
False,
Expand Down
5 changes: 5 additions & 0 deletions test-data/unit/check-ignore.test
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ IGNORE
# type: ignore
import MISSING

[case testIgnoreWholeModulePy27]
# flags: --python-version 2.7
# type: ignore
IGNORE

[case testDontIgnoreWholeModule1]
if True:
# type: ignore
Expand Down