mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-04-14 22:24:25 +03:00
fix return
This commit is contained in:
parent
586ba89047
commit
3d128ca5ca
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user