Fix potential issubclass crash

master
Cristi Vîjdea 2019-06-13 13:43:13 +03:00
parent 2656696a0f
commit 753be1a8bd
1 changed files with 1 additions and 1 deletions

View File

@ -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: