Another batch of type annotations (#12726)

This commit is contained in:
David Robertson 2022-05-13 12:35:31 +01:00 committed by GitHub
parent 39bed28b28
commit aec69d2481
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 144 additions and 79 deletions

View file

@ -16,6 +16,8 @@
import logging
import traceback
from io import StringIO
from types import TracebackType
from typing import Optional, Tuple, Type
class LogFormatter(logging.Formatter):
@ -28,10 +30,14 @@ class LogFormatter(logging.Formatter):
where it was caught are logged).
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def formatException(self, ei):
def formatException(
self,
ei: Tuple[
Optional[Type[BaseException]],
Optional[BaseException],
Optional[TracebackType],
],
) -> str:
sio = StringIO()
(typ, val, tb) = ei