summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-06-12 23:53:15 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-06-12 23:59:11 +0200
commit8fdb5b09be656ffc5c6c39c76b14038d9233eae3 (patch)
tree59ce11226d8cbf86de2abfcb584c58d7a3a3b7f1
parenteeb39d633004c00f21749b964cdf5b0d66ae371c (diff)
downloadqutebrowser-8fdb5b09be656ffc5c6c39c76b14038d9233eae3.tar.gz
qutebrowser-8fdb5b09be656ffc5c6c39c76b14038d9233eae3.zip
qt: Fix typing/lint
-rw-r--r--qutebrowser/qt/machinery.py2
-rw-r--r--qutebrowser/qt/sip.py4
-rw-r--r--tests/unit/test_qt_machinery.py8
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,
):