Skip to content

Commit 091847e

Browse files
Fix get_doc_string.
1 parent bebeab0 commit 091847e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tabpy/tabpy_tools/custom_query_object.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ def query(self, *args, **kwargs):
7575
def get_doc_string(self):
7676
"""Get doc string from customized query"""
7777
default_docstring = "-- no docstring found in query function --"
78-
if platform.system() == "Windows" and sys.maxsize <= 2**32:
78+
79+
# TODO: fix docstring parsing on Windows systems
80+
if sys.platform == 'win32':
7981
return default_docstring
80-
else:
81-
return inspect.getdoc(self.custom_query) or default_docstring
82+
83+
ds = getattr(self.custom_query, '__doc__', None)
84+
return ds if ds and isinstance(ds, str) else default_docstring
8285

8386
def get_methods(self):
8487
return [self.get_query_method()]

0 commit comments

Comments
 (0)