From c158cafe3395e130946cb192247e544251da8601 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 18 Mar 2021 15:24:58 +0100 Subject: Fix lint As for the mypy unreachable warning, see: See https://github.com/python/mypy/issues/7214 and https://github.com/python/mypy/issues/8766 Includes cherry-pick of 27ad47825279a39141efd11ec9cc54ff2a872517 --- qutebrowser/commands/parser.py | 4 ++-- qutebrowser/commands/runners.py | 6 ++---- qutebrowser/misc/earlyinit.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/qutebrowser/commands/parser.py b/qutebrowser/commands/parser.py index 5adbc003c..06a20cdf6 100644 --- a/qutebrowser/commands/parser.py +++ b/qutebrowser/commands/parser.py @@ -15,12 +15,12 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . +# along with qutebrowser. If not, see . """Module for parsing commands entered into the browser.""" import dataclasses -from typing import Optional, List, Mapping, Iterator, Union +from typing import List, Iterator from qutebrowser.commands import cmdexc, command from qutebrowser.misc import split, objects diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index 7386d7d3b..5fb054455 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -22,13 +22,11 @@ import traceback import re import contextlib -from typing import (TYPE_CHECKING, Callable, Dict, Iterator, Mapping, MutableMapping, - List, Optional) +from typing import TYPE_CHECKING, Callable, Dict, Iterator, Mapping, MutableMapping from PyQt5.QtCore import pyqtSlot, QUrl, QObject from qutebrowser.api import cmdutils -from qutebrowser.config import config from qutebrowser.commands import cmdexc, parser from qutebrowser.utils import message, objreg, qtutils, usertypes, utils from qutebrowser.keyinput import macros, modeman @@ -175,7 +173,7 @@ class CommandRunner(AbstractCommandRunner): parsed = self._parser.parse_all(text) if parsed is None: - return + return # type: ignore[unreachable] for result in parsed: with self._handle_error(safely): diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index ecd3fac1a..ca8f9e8fe 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -289,7 +289,7 @@ def webengine_early_import(): error messages in backendproblem.py are accurate. """ try: - from PyQt5 import QtWebEngineWidgets + from PyQt5 import QtWebEngineWidgets # pylint: disable=unused-import except ImportError: pass -- cgit v1.2.3-54-g00ecf