Skip to content

Commit cef04d7

Browse files
return utf-8
1 parent 6696388 commit cef04d7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tabpy/tabpy_tools/custom_query_object.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,13 @@ def query(self, *args, **kwargs):
7272
def get_doc_string(self):
7373
"""Get doc string from customized query"""
7474
try:
75-
return str(
76-
self.custom_query.__doc__ or "-- no docstring found in query function --"
77-
)
78-
except:
75+
if self.custom_query.__doc__ is not None:
76+
return str(
77+
bytes(self.custom_query.__doc__, "utf-8").decode("unicode_escape")
78+
)
79+
else:
80+
return "-- no docstring found in query function --"
81+
except Exception as e:
7982
return "-- no docstring found in query function --"
8083

8184
def get_methods(self):

0 commit comments

Comments
 (0)