diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-10-05 20:21:33 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-10-05 20:26:56 +0200 |
commit | 61852e5b4fad847df0d9d12f247bbc194825fa2f (patch) | |
tree | 3ee4743f8bb022c7f1c8c41ba15b8f2e8f896b99 | |
parent | b8db878cbec08f9162fe4fc65c2ee2eb19f27446 (diff) | |
download | qutebrowser-61852e5b4fad847df0d9d12f247bbc194825fa2f.tar.gz qutebrowser-61852e5b4fad847df0d9d12f247bbc194825fa2f.zip |
Fix lint
-rw-r--r-- | qutebrowser/config/qtargs.py | 8 | ||||
-rw-r--r-- | tests/unit/config/test_qtargs.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/qutebrowser/config/qtargs.py b/qutebrowser/config/qtargs.py index 46b54cf34..9ed2ce6e0 100644 --- a/qutebrowser/config/qtargs.py +++ b/qutebrowser/config/qtargs.py @@ -28,7 +28,7 @@ try: from PyQt5.QtWebEngine import PYQT_WEBENGINE_VERSION except ImportError: # Added in PyQt 5.13 - PYQT_WEBENGINE_VERSION = None + PYQT_WEBENGINE_VERSION = None # type: ignore[assignment] from qutebrowser.config import config from qutebrowser.misc import objects @@ -69,7 +69,8 @@ def qt_args(namespace: argparse.Namespace) -> typing.List[str]: def _darkmode_prefix() -> str: """Return the prefix to use for darkmode settings.""" - if PYQT_WEBENGINE_VERSION is None or PYQT_WEBENGINE_VERSION < 0x050f02: + if (PYQT_WEBENGINE_VERSION is None or # type: ignore[unreachable] + PYQT_WEBENGINE_VERSION < 0x050f02): return 'darkMode' else: # QtWebEngine 5.15.2 comes with Chromium 83 @@ -159,7 +160,8 @@ def _darkmode_settings() -> typing.Iterator[typing.Tuple[str, str]]: if isinstance(value, usertypes.Unset): continue - if setting == 'policy.images' and value == 'smart' and smart_image_policy_broken: + if (setting == 'policy.images' and value == 'smart' and + smart_image_policy_broken): # WORKAROUND for # https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/304211 log.init.warning("Ignoring colors.webpage.darkmode.policy.images = smart " diff --git a/tests/unit/config/test_qtargs.py b/tests/unit/config/test_qtargs.py index 49ace57bc..36b01df2b 100644 --- a/tests/unit/config/test_qtargs.py +++ b/tests/unit/config/test_qtargs.py @@ -506,7 +506,7 @@ class TestDarkMode: expected = [] expected.append((add_prefix('Enabled'), 'true')) if exp_key != 'ImagePolicy': - expected.append((add_prefix('ImagePolicy'), '2')), + expected.append((add_prefix('ImagePolicy'), '2')) expected.append((add_prefix(exp_key), exp_val)) assert list(qtargs._darkmode_settings()) == expected |