mypy: Update ignore comments

This commit is contained in:
Florian Bruhin 2021-01-25 11:18:23 +01:00
parent 4a9dea0aef
commit 2d6d9e108e
3 changed files with 3 additions and 5 deletions

View File

@ -122,7 +122,7 @@ def _walk_pyinstaller() -> Iterator[ExtensionInfo]:
toc: Set[str] = set()
for importer in pkgutil.iter_importers('qutebrowser'):
if hasattr(importer, 'toc'):
toc |= importer.toc
toc |= importer.toc # type: ignore[union-attr]
for name in toc:
if name.startswith(components.__name__ + '.'):
yield ExtensionInfo(name=name)

View File

@ -49,8 +49,7 @@ def check_python_version():
version_str = '.'.join(map(str, sys.version_info[:3]))
text = ("At least Python 3.6.1 is required to run qutebrowser, but " +
"it's running with " + version_str + ".\n")
if (Tk and # type: ignore[unreachable]
'--no-err-windows' not in sys.argv): # pragma: no cover
if Tk and '--no-err-windows' not in sys.argv: # pragma: no cover
root = Tk()
root.withdraw()
messagebox.showerror("qutebrowser: Fatal error!", text)

View File

@ -491,8 +491,7 @@ def qt_message_handler(msg_type: QtCore.QtMsgType,
else:
func = context.function
if (context.category is None or # type: ignore[unreachable]
context.category == 'default'):
if context.category is None or context.category == 'default':
name = 'qt'
else:
name = 'qt-' + context.category