summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-18 15:24:58 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-18 15:33:45 +0100
commitc158cafe3395e130946cb192247e544251da8601 (patch)
treeef67df64cf200b33d25875fbc0e4af498a1378bc
parent3d1f975391ef61a43490e93b4ce0c54fdd5c22ab (diff)
downloadqutebrowser-dev-split-parser.tar.gz
qutebrowser-dev-split-parser.zip
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
-rw-r--r--qutebrowser/commands/parser.py4
-rw-r--r--qutebrowser/commands/runners.py6
-rw-r--r--qutebrowser/misc/earlyinit.py2
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 <http://www.gnu.org/licenses/>.
+# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
"""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