From c056964d80181601d11e9d9d177e279028cde5c2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 28 Jun 2021 19:27:30 +0200 Subject: Fix lint (cherry picked from commit 4c479bb4ab9a25276ea9045c99b690dc925dd345) --- qutebrowser/components/braveadblock.py | 9 +++------ 1 file 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: -- cgit v1.2.3-54-g00ecf