summaryrefslogtreecommitdiff
path: root/qutebrowser/utils/log.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-12-20 12:07:02 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-12-20 12:14:19 +0100
commit450619e25af5ab8bf7352bae85c59002fe09ec49 (patch)
treea9e3c275656e3d33c9b9a698ff0800666407e0b1 /qutebrowser/utils/log.py
parent1d0787f852ebc8ac6217c0d07445950f921142b7 (diff)
downloadqutebrowser-450619e25af5ab8bf7352bae85c59002fe09ec49.tar.gz
qutebrowser-450619e25af5ab8bf7352bae85c59002fe09ec49.zip
Update annotations for new mypy
Diffstat (limited to 'qutebrowser/utils/log.py')
-rw-r--r--qutebrowser/utils/log.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py
index 54ca4029b..6677e383e 100644
--- a/qutebrowser/utils/log.py
+++ b/qutebrowser/utils/log.py
@@ -43,7 +43,9 @@ except ImportError:
colorama = None
if TYPE_CHECKING:
+ # pylint: disable=unused-import
from qutebrowser.config import config as configmodule
+ from typing import TextIO
_log_inited = False
_args = None
@@ -257,7 +259,7 @@ def _init_handlers(
force_color: bool,
json_logging: bool,
ram_capacity: int
-) -> Tuple[logging.StreamHandler, Optional['RAMHandler']]:
+) -> Tuple["logging.StreamHandler[TextIO]", Optional['RAMHandler']]:
"""Init log handlers.
Args:
@@ -727,7 +729,8 @@ class ColoredFormatter(logging.Formatter):
datefmt: str,
style: str, *,
use_colors: bool) -> None:
- super().__init__(fmt, datefmt, style)
+ super().__init__(fmt, datefmt, style) # type: ignore[arg-type]
+ # FIXME Use Literal["%", "{", "$"] once we use Python 3.8 or typing_extensions
self.use_colors = use_colors
def format(self, record: logging.LogRecord) -> str: