mirror of https://github.com/tiangolo/fastapi.git
fixup! Fix `NoneType` return type for 204 endpoints
This commit is contained in:
parent
fd1e651357
commit
e1843d0e08
|
|
@ -278,8 +278,7 @@ def get_typed_return_annotation(call: Callable[..., Any]) -> Any:
|
|||
globalns = getattr(call, "__globals__", {})
|
||||
typed_annotation = get_typed_annotation(annotation, globalns)
|
||||
|
||||
NoneType = type(None)
|
||||
if issubclass(typed_annotation, NoneType):
|
||||
if typed_annotation is type(None): # noqa: E721
|
||||
return None
|
||||
|
||||
return typed_annotation
|
||||
|
|
|
|||
Loading…
Reference in New Issue