diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-06-28 19:27:30 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-06-28 19:30:59 +0200 |
commit | c056964d80181601d11e9d9d177e279028cde5c2 (patch) | |
tree | e5e8b421fdc90ece44aac5c2e2a2287ef14a67ce | |
parent | a78a3c0478056c43c4b37877900ece68a1c5c737 (diff) | |
download | qutebrowser-c056964d80181601d11e9d9d177e279028cde5c2.tar.gz qutebrowser-c056964d80181601d11e9d9d177e279028cde5c2.zip |
Fix lint
(cherry picked from commit 4c479bb4ab9a25276ea9045c99b690dc925dd345)
-rw-r--r-- | qutebrowser/components/braveadblock.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/qutebrowser/components/braveadblock.py b/qutebrowser/components/braveadblock.py index 75d3325ed..71add4124 100644 --- a/qutebrowser/components/braveadblock.py +++ b/qutebrowser/components/braveadblock.py @@ -24,7 +24,7 @@ import logging import pathlib import functools import contextlib -from typing import Optional, IO +from typing import Optional, IO, Iterator from PyQt5.QtCore import QUrl @@ -124,11 +124,9 @@ class DeserializationError(Exception): See _map_exception below for details. """ - pass - @contextlib.contextmanager -def _map_exceptions(): +def _map_exceptions() -> Iterator[None]: """Handle exception API differences in adblock 0.5.0. adblock < 0.5.0 will raise a ValueError with a string describing the @@ -150,7 +148,6 @@ def _map_exceptions(): raise DeserializationError(str(e)) - class BraveAdBlocker: """Manage blocked hosts based on Brave's adblocker. @@ -249,7 +246,7 @@ class BraveAdBlocker: try: with _map_exceptions(): self._engine.deserialize_from_file(str(self._cache_path)) - except DeserializationError as e: + except DeserializationError: message.error("Reading adblock filter data failed (corrupted data?). " "Please run :adblock-update.") else: |