From dc668a25be4df8ff95a3b14c438df5a5557c4aef Mon Sep 17 00:00:00 2001 From: Jake Ichikawa Date: Thu, 21 Nov 2024 10:17:22 -0800 Subject: [PATCH] Fix for win32. --- tabpy/tabpy_tools/custom_query_object.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tabpy/tabpy_tools/custom_query_object.py b/tabpy/tabpy_tools/custom_query_object.py index 9d649c48..077e3414 100644 --- a/tabpy/tabpy_tools/custom_query_object.py +++ b/tabpy/tabpy_tools/custom_query_object.py @@ -71,12 +71,10 @@ def query(self, *args, **kwargs): def get_doc_string(self): """Get doc string from customized query""" - if self.custom_query.__doc__: - encoding = "utf-8" if sys.platform != "win32" else "cp1252" - return str( - bytes(self.custom_query.__doc__, encoding).decode("unicode_escape") - ) - return "-- no docstring found in query function --" + if self.custom_query.__doc__ is not None and sys.platform != "win32": + return self.custom_query.__doc__ + else: + return "-- no docstring found in query function --" def get_methods(self): return [self.get_query_method()]