Add _typeshed.(Opt)ExcInfo (#7645)

This commit is contained in:
Sebastian Rittau
2022-04-18 01:28:43 +02:00
committed by GitHub
parent a24b765388
commit 321359ca31
7 changed files with 26 additions and 31 deletions

View File

@@ -1,16 +1,13 @@
from _typeshed import OptExcInfo
from _typeshed.wsgi import ErrorStream, InputStream, StartResponse, WSGIApplication, WSGIEnvironment
from abc import abstractmethod
from types import TracebackType
from typing import IO, Callable, MutableMapping
from typing_extensions import TypeAlias
from .headers import Headers
from .util import FileWrapper
__all__ = ["BaseHandler", "SimpleHandler", "BaseCGIHandler", "CGIHandler", "IISCGIHandler", "read_environ"]
_exc_info: TypeAlias = tuple[type[BaseException] | None, BaseException | None, TracebackType | None]
def format_date_time(timestamp: float | None) -> str: ... # undocumented
def read_environ() -> dict[str, str]: ...
@@ -40,7 +37,7 @@ class BaseHandler:
def set_content_length(self) -> None: ...
def cleanup_headers(self) -> None: ...
def start_response(
self, status: str, headers: list[tuple[str, str]], exc_info: _exc_info | None = ...
self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ...
) -> Callable[[bytes], None]: ...
def send_preamble(self) -> None: ...
def write(self, data: bytes) -> None: ...
@@ -50,7 +47,7 @@ class BaseHandler:
def send_headers(self) -> None: ...
def result_is_file(self) -> bool: ...
def client_is_modern(self) -> bool: ...
def log_exception(self, exc_info: _exc_info) -> None: ...
def log_exception(self, exc_info: OptExcInfo) -> None: ...
def handle_error(self) -> None: ...
def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ...
@abstractmethod