From 8fdb5b09be656ffc5c6c39c76b14038d9233eae3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 12 Jun 2023 23:53:15 +0200 Subject: qt: Fix typing/lint --- qutebrowser/qt/machinery.py | 2 +- qutebrowser/qt/sip.py | 4 ++-- tests/unit/test_qt_machinery.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qutebrowser/qt/machinery.py b/qutebrowser/qt/machinery.py index 2b1143887..255eb24af 100644 --- a/qutebrowser/qt/machinery.py +++ b/qutebrowser/qt/machinery.py @@ -146,7 +146,7 @@ def init(args: Optional[argparse.Namespace] = None) -> None: else: # Explicit initialization can happen exactly once, and if it's used, there # should not be any implicit initialization (qutebrowser.qt imports) before it. - if _initialized: + if _initialized: # pylint: disable=else-if-used raise Error("init() already called before application init") _initialized = True diff --git a/qutebrowser/qt/sip.py b/qutebrowser/qt/sip.py index 3d2c51c39..860c1ee4f 100644 --- a/qutebrowser/qt/sip.py +++ b/qutebrowser/qt/sip.py @@ -1,5 +1,5 @@ # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: -# pylint: disable=import-error,wildcard-import,unused-wildcard-import +# pylint: disable=wildcard-import,unused-wildcard-import """Wrapped Qt imports for PyQt5.sip/PyQt6.sip. @@ -32,6 +32,6 @@ elif machinery.USE_PYQT6: # While upstream recommends using PyQt5.sip ever since PyQt5 5.11, some # distributions still package later versions of PyQt5 with a top-level # "sip" rather than "PyQt5.sip". - from sip import * # type: ignore[import] + from sip import * else: raise machinery.UnknownWrapper() diff --git a/tests/unit/test_qt_machinery.py b/tests/unit/test_qt_machinery.py index ffbb39543..7ae5576d1 100644 --- a/tests/unit/test_qt_machinery.py +++ b/tests/unit/test_qt_machinery.py @@ -22,7 +22,7 @@ import sys import argparse import typing -from typing import Any, Optional +from typing import Any, Optional, Dict, List import pytest @@ -42,7 +42,7 @@ def modules(): def test_autoselect_none_available( stubs: Any, - modules: dict[str, bool], + modules: Dict[str, bool], monkeypatch: pytest.MonkeyPatch, ): stubs.ImportFake(modules, monkeypatch).patch() @@ -62,8 +62,8 @@ def test_autoselect_none_available( ) def test_autoselect( stubs: Any, - modules: dict[str, bool], - available: list[str], + modules: Dict[str, bool], + available: List[str], expected: str, monkeypatch: pytest.MonkeyPatch, ): -- cgit v1.2.3-54-g00ecf