Fix potential issubclass crash
parent
2656696a0f
commit
753be1a8bd
|
|
@ -610,7 +610,7 @@ class SerializerMethodFieldInspector(FieldInspector):
|
||||||
# look for Python 3.5+ style type hinting of the return value
|
# look for Python 3.5+ style type hinting of the return value
|
||||||
hint_class = inspect_signature(method).return_annotation
|
hint_class = inspect_signature(method).return_annotation
|
||||||
|
|
||||||
if not issubclass(hint_class, inspect._empty):
|
if inspect.isclass(hint_class) and not issubclass(hint_class, inspect._empty):
|
||||||
type_info = get_basic_type_info_from_hint(hint_class)
|
type_info = get_basic_type_info_from_hint(hint_class)
|
||||||
|
|
||||||
if type_info is not None:
|
if type_info is not None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue