File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
tests/unit/samples/wiring Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -321,13 +321,7 @@ def _is_werkzeug_local_proxy(self, instance: object) -> bool:
321321 def _is_starlette_request_cls (self , instance : object ) -> bool :
322322 return starlette \
323323 and isinstance (instance , type ) \
324- and self ._safe_is_subclass (instance , starlette .requests .Request )
325-
326- def _safe_is_subclass (self , instance : type , cls : type ) -> bool :
327- try :
328- return issubclass (instance , cls )
329- except TypeError :
330- return False
324+ and _safe_is_subclass (instance , starlette .requests .Request )
331325
332326 def _is_builtin (self , instance : object ) -> bool :
333327 return inspect .isbuiltin (instance )
@@ -685,6 +679,13 @@ def _is_declarative_container(instance: Any) -> bool:
685679 and getattr (instance , "declarative_parent" , None ) is None )
686680
687681
682+ def _safe_is_subclass (instance : Any , cls : Type ) -> bool :
683+ try :
684+ return issubclass (instance , cls )
685+ except TypeError :
686+ return False
687+
688+
688689class Modifier :
689690
690691 def modify (
Original file line number Diff line number Diff line change 55if "pypy" not in sys .version .lower ():
66 import numpy # noqa
77 from numpy import * # noqa
8- from numpy .typing import * # noqa
8+ if sys .version_info >= (3 , 7 ):
9+ from numpy .typing import * # noqa
910
1011 import scipy # noqa
1112 from scipy import * # noqa
You can’t perform that action at this time.
0 commit comments