From e1843d0e08d7ca4c0dd10bf8657c2d0f34cca11e Mon Sep 17 00:00:00 2001 From: matiuszka Date: Mon, 9 Jan 2023 11:52:27 +0100 Subject: [PATCH] fixup! Fix `NoneType` return type for 204 endpoints --- fastapi/dependencies/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index 3d3faec894..412bbfcad3 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -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