(
*args: t.Any, **kwargs: t.Any
)
| 407 | chunks: list[int] = [] |
| 408 | |
| 409 | def checking_start_response( |
| 410 | *args: t.Any, **kwargs: t.Any |
| 411 | ) -> t.Callable[[bytes], None]: |
| 412 | if len(args) not in {2, 3}: |
| 413 | warn( |
| 414 | f"Invalid number of arguments: {len(args)}, expected 2 or 3.", |
| 415 | WSGIWarning, |
| 416 | stacklevel=2, |
| 417 | ) |
| 418 | |
| 419 | if kwargs: |
| 420 | warn( |
| 421 | "'start_response' does not take keyword arguments.", |
| 422 | WSGIWarning, |
| 423 | stacklevel=2, |
| 424 | ) |
| 425 | |
| 426 | status: str = args[0] |
| 427 | headers: list[tuple[str, str]] = args[1] |
| 428 | exc_info: ( |
| 429 | None | (tuple[type[BaseException], BaseException, TracebackType]) |
| 430 | ) = args[2] if len(args) == 3 else None |
| 431 | |
| 432 | headers_set[:] = self.check_start_response(status, headers, exc_info) |
| 433 | return GuardedWrite(start_response(status, headers, exc_info), chunks) |
| 434 | |
| 435 | app_iter = self.app(environ, t.cast("StartResponse", checking_start_response)) |
| 436 | self.check_iterator(app_iter) |
nothing calls this directly
no test coverage detected