From 404e33d3cc7214e72c5b497701617b42389ee66a Mon Sep 17 00:00:00 2001 From: jaswanth098 Date: Wed, 30 Oct 2019 14:04:31 +0530 Subject: [PATCH] fixed bug with typing return types --- kwikapi/apidoc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kwikapi/apidoc.py b/kwikapi/apidoc.py index e187858..0db8d45 100644 --- a/kwikapi/apidoc.py +++ b/kwikapi/apidoc.py @@ -11,7 +11,13 @@ def _type_str(self, t): if t is None: return str(None) - return t.__name__ + if hasattr(t, "__name__"): + return t.__name__ + else: + try: + return t.__repr__() + except Exception: + return "Unknown" def apidoc(self, version: str = None, namespace: str = None) -> dict: versions = {}