Skip to content

Commit

Permalink
Fix some inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Jul 23, 2023
1 parent 6ec2072 commit 381f83f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion starlette/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
def md5_hexdigest(
data: bytes, *, usedforsecurity: bool = True
) -> str: # pragma: no cover
return hashlib.md5(data, usedforsecurity=usedforsecurity).hexdigest() # type: ignore[call-arg] # noqa: E501
return hashlib.md5( # type: ignore[call-arg]
data, usedforsecurity=usedforsecurity
).hexdigest()

except TypeError: # pragma: no cover

Expand Down
5 changes: 1 addition & 4 deletions starlette/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ def __init__(
routes: typing.Optional[typing.Sequence[BaseRoute]] = None,
middleware: typing.Optional[typing.Sequence[Middleware]] = None,
exception_handlers: typing.Optional[
typing.Mapping[
typing.Any,
ExceptionHandler,
]
typing.Mapping[typing.Any, ExceptionHandler]
] = None,
on_startup: typing.Optional[
typing.Sequence[typing.Callable[[], typing.Any]]
Expand Down
2 changes: 1 addition & 1 deletion starlette/middleware/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
self._status_handlers: StatusHandlers = {}
self._exception_handlers: ExceptionHandlers = {
HTTPException: self.http_exception,
WebSocketException: self.websocket_exception, # type: ignore[dict-item]
WebSocketException: self.websocket_exception,
}
if handlers is not None:
for key, value in handlers.items():
Expand Down
2 changes: 1 addition & 1 deletion starlette/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
typing.Callable[
["Request", Exception], typing.Union["Response", typing.Awaitable["Response"]]
],
typing.Callable[["WebSocket", Exception], None],
typing.Callable[["WebSocket", Exception], typing.Awaitable[None]],
]

0 comments on commit 381f83f

Please sign in to comment.