summaryrefslogtreecommitdiff
path: root/qutebrowser/components/braveadblock.py
diff options
context:
space:
mode:
Diffstat (limited to 'qutebrowser/components/braveadblock.py')
-rw-r--r--qutebrowser/components/braveadblock.py9
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: