summaryrefslogtreecommitdiff
path: root/qutebrowser/commands
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-05-10 19:11:18 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-05-10 19:11:18 +0200
commit341aa4ea751bc7e15a421e0ffe91d1d06812ae97 (patch)
tree1f8838b272bd49f7c3aec1a3939141304d9159b6 /qutebrowser/commands
parent3f79308ffdf703a28c2b8a81e08affd5b64729b1 (diff)
downloadqutebrowser-341aa4ea751bc7e15a421e0ffe91d1d06812ae97.tar.gz
qutebrowser-341aa4ea751bc7e15a421e0ffe91d1d06812ae97.zip
mypy: Use explicit "type: ignore[...]" ignores
See #5368
Diffstat (limited to 'qutebrowser/commands')
-rw-r--r--qutebrowser/commands/command.py7
-rw-r--r--qutebrowser/commands/runners.py2
-rw-r--r--qutebrowser/commands/userscripts.py5
3 files changed, 8 insertions, 6 deletions
diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py
index 44d639e0a..4eefe481c 100644
--- a/qutebrowser/commands/command.py
+++ b/qutebrowser/commands/command.py
@@ -244,7 +244,7 @@ class Command:
args = self._param_to_argparse_args(param, is_bool)
callsig = debug_utils.format_call(self.parser.add_argument, args,
kwargs, full=False)
- log.commands.vdebug( # type: ignore
+ log.commands.vdebug( # type: ignore[attr-defined]
'Adding arg {} of type {} -> {}'
.format(param.name, typ, callsig))
self.parser.add_argument(*args, **kwargs)
@@ -409,7 +409,8 @@ class Command:
if hasattr(typing, 'UnionMeta'):
# Python 3.5.2
# pylint: disable=no-member,useless-suppression
- is_union = isinstance(typ, typing.UnionMeta) # type: ignore
+ is_union = isinstance(
+ typ, typing.UnionMeta) # type: ignore[attr-defined]
else:
is_union = getattr(typ, '__origin__', None) is typing.Union
@@ -575,7 +576,7 @@ class Command:
def register(self):
"""Register this command in objects.commands."""
- log.commands.vdebug( # type: ignore
+ log.commands.vdebug( # type: ignore[attr-defined]
"Registering command {} (from {}:{})".format(
self.name, self.handler.__module__, self.handler.__qualname__))
if self.name in objects.commands:
diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py
index 2537e1d9c..ec052b263 100644
--- a/qutebrowser/commands/runners.py
+++ b/qutebrowser/commands/runners.py
@@ -94,7 +94,7 @@ def _init_variable_replacements() -> typing.Mapping[str, _ReplacementFunction]:
modified_key = '{' + key + '}'
# x = modified_key is to avoid binding x as a closure
replacements[modified_key] = (
- lambda _, x=modified_key: x) # type: ignore
+ lambda _, x=modified_key: x) # type: ignore[misc]
return replacements
diff --git a/qutebrowser/commands/userscripts.py b/qutebrowser/commands/userscripts.py
index f9e9af484..b9ef41f01 100644
--- a/qutebrowser/commands/userscripts.py
+++ b/qutebrowser/commands/userscripts.py
@@ -62,7 +62,8 @@ class _QtFIFOReader(QObject):
self._fifo = os.fdopen(fd, 'r')
self._notifier = QSocketNotifier(typing.cast(sip.voidptr, fd),
QSocketNotifier.Read, self)
- self._notifier.activated.connect(self.read_line) # type: ignore
+ self._notifier.activated.connect( # type: ignore[attr-defined]
+ self.read_line)
@pyqtSlot()
def read_line(self):
@@ -265,7 +266,7 @@ class _POSIXUserscriptRunner(_BaseUserscriptRunner):
return
self._reader = _QtFIFOReader(self._filepath)
- self._reader.got_line.connect(self.got_cmd) # type: ignore
+ self._reader.got_line.connect(self.got_cmd) # type: ignore[arg-type]
@pyqtSlot()
def on_proc_finished(self):