Skip to content

Commit

Permalink
Make invalid type ignore comments non-blocking
Browse files Browse the repository at this point in the history
Blocking errors are a bad user experience and there's no reason for this
one to be one / there is another code path for invalid type ignores that
is non-blocking.

Fixes half of python#12299. The half it doesn't fix is that ideally users
shouldn't be getting these warnings from third party libraries.
Also see python#12162 (comment)
But that's for another PR
  • Loading branch information
hauntsaninja committed Aug 25, 2022
1 parent f83835c commit c82781c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ def visit_Module(self, mod: ast3.Module) -> MypyFile:
if parsed is not None:
self.type_ignores[ti.lineno] = parsed
else:
self.fail(INVALID_TYPE_IGNORE, ti.lineno, -1)
self.fail(INVALID_TYPE_IGNORE, ti.lineno, -1, blocker=False)
body = self.fix_function_overloads(self.translate_stmt_list(mod.body, ismodule=True))
return MypyFile(body, self.imports, False, self.type_ignores)

Expand Down

0 comments on commit c82781c

Please sign in to comment.