Skip to content

Commit

Permalink
fixup! Fix NoneType return type for 204 endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
matiuszka committed Jan 9, 2023
1 parent 2fb954e commit fd1e651
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastapi/dependencies/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
Union,
cast,
)
import types

import anyio
from fastapi import params
Expand Down Expand Up @@ -279,7 +278,8 @@ def get_typed_return_annotation(call: Callable[..., Any]) -> Any:
globalns = getattr(call, "__globals__", {})
typed_annotation = get_typed_annotation(annotation, globalns)

if typed_annotation is types.NoneType:
NoneType = type(None)
if issubclass(typed_annotation, NoneType):
return None

return typed_annotation
Expand Down

0 comments on commit fd1e651

Please sign in to comment.