File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
azure-functions-extension-base/azure/functions/extension/base Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11from abc import abstractmethod
22from enum import Enum
3+ import inspect
34from typing import Callable
45
56base_extension_module = __name__
@@ -53,7 +54,9 @@ def get_request_type(cls):
5354
5455 @classmethod
5556 def check_type (cls , pytype : type ) -> bool :
56- return cls ._request_type is not None and issubclass (pytype , cls ._request_type )
57+ if pytype is not None and inspect .isclass (pytype ):
58+ return cls ._request_type is not None and issubclass (pytype , cls ._request_type )
59+ return False
5760
5861
5962class ResponseTrackerMeta (type ):
@@ -87,8 +90,10 @@ def get_response_type(cls, label):
8790
8891 @classmethod
8992 def check_type (cls , pytype : type ) -> bool :
90- return cls ._response_types is not None and any (issubclass (pytype , response_type )
91- for response_type in cls ._response_types .values ())
93+ if pytype is not None and inspect .isclass (pytype ):
94+ return cls ._response_types is not None and any (issubclass (pytype , response_type )
95+ for response_type in cls ._response_types .values ())
96+ return False
9297
9398class WebApp (metaclass = ModuleTrackerMeta ):
9499 @abstractmethod
You can’t perform that action at this time.
0 commit comments