fix return

This commit is contained in:
VKFisher 2022-03-22 16:37:34 +07:00
parent 586ba89047
commit 3d128ca5ca

View File

@ -321,11 +321,11 @@ class InspectFilter:
def _is_starlette_request_cls(self, instance: object) -> bool:
return starlette \
and isinstance(instance, type) \
and self._is_subclass(instance, starlette.requests.Request)
and self._safe_is_subclass(instance, starlette.requests.Request)
def _is_subclass(self, instance: type, cls: type) -> bool:
def _safe_is_subclass(self, instance: type, cls: type) -> bool:
try:
issubclass(instance, cls)
return issubclass(instance, cls)
except TypeError:
return False