diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-05-10 19:11:18 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-05-10 19:11:18 +0200 |
commit | 341aa4ea751bc7e15a421e0ffe91d1d06812ae97 (patch) | |
tree | 1f8838b272bd49f7c3aec1a3939141304d9159b6 /qutebrowser/browser/hints.py | |
parent | 3f79308ffdf703a28c2b8a81e08affd5b64729b1 (diff) | |
download | qutebrowser-341aa4ea751bc7e15a421e0ffe91d1d06812ae97.tar.gz qutebrowser-341aa4ea751bc7e15a421e0ffe91d1d06812ae97.zip |
mypy: Use explicit "type: ignore[...]" ignores
See #5368
Diffstat (limited to 'qutebrowser/browser/hints.py')
-rw-r--r-- | qutebrowser/browser/hints.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index e564e7249..ba4aaac51 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -235,7 +235,7 @@ class HintActions: flags = QUrl.FullyEncoded | QUrl.RemovePassword if url.scheme() == 'mailto': flags |= QUrl.RemoveScheme - urlstr = url.toString(flags) # type: ignore + urlstr = url.toString(flags) # type: ignore[arg-type] new_content = urlstr @@ -256,14 +256,15 @@ class HintActions: def run_cmd(self, url: QUrl, context: HintContext) -> None: """Run the command based on a hint URL.""" - urlstr = url.toString(QUrl.FullyEncoded) # type: ignore + urlstr = url.toString(QUrl.FullyEncoded) # type: ignore[arg-type] args = context.get_args(urlstr) commandrunner = runners.CommandRunner(self._win_id) commandrunner.run_safely(' '.join(args)) def preset_cmd_text(self, url: QUrl, context: HintContext) -> None: """Preset a commandline text based on a hint URL.""" - urlstr = url.toDisplayString(QUrl.FullyEncoded) # type: ignore + flags = QUrl.FullyEncoded + urlstr = url.toDisplayString(flags) # type: ignore[arg-type] args = context.get_args(urlstr) text = ' '.join(args) if text[0] not in modeparsers.STARTCHARS: @@ -308,7 +309,8 @@ class HintActions: } url = elem.resolve_url(context.baseurl) if url is not None: - env['QUTE_URL'] = url.toString(QUrl.FullyEncoded) # type: ignore + flags = QUrl.FullyEncoded + env['QUTE_URL'] = url.toString(flags) # type: ignore[arg-type] try: userscripts.run_async(context.tab, cmd, *args, win_id=self._win_id, @@ -328,7 +330,7 @@ class HintActions: context: The HintContext to use. """ urlstr = url.toString( - QUrl.FullyEncoded | QUrl.RemovePassword) # type: ignore + QUrl.FullyEncoded | QUrl.RemovePassword) # type: ignore[arg-type] args = context.get_args(urlstr) commandrunner = runners.CommandRunner(self._win_id) commandrunner.run_safely('spawn ' + ' '.join(args)) |