aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-04-18 12:36:29 +0200
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-04-22 11:49:29 +0200
commita5b76f26f1abf81c37ca7646b87536fae46d8ba1 (patch)
tree0ea87c093cb78c0476573a9a93587e63f7d0ecc3
parent7869f122cd7fe37a65382e8d2900b11d64acbf09 (diff)
signature: Add comparison for existing_doc type
Fixes: PYSIDE-1272 Change-Id: If7060574851c10994b06875d3a6ce16500e75199 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
index cb148830f..67ff67722 100644
--- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
+++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
@@ -122,6 +122,11 @@ def seterror_argument(args, func_name):
# We don't raise the error here, to avoid the loader in the traceback.
return TypeError, msg
+def check_string_type(s):
+ if sys.version_info[0] == 3:
+ return isinstance(s, str)
+ else:
+ return isinstance(s, (str, unicode))
def make_helptext(func):
existing_doc = func.__doc__
@@ -135,7 +140,7 @@ def make_helptext(func):
except AttribureError:
func_name = func.__func__.__name__
sigtext = "\n".join(func_name + str(sig) for sig in sigs)
- msg = sigtext + "\n\n" + existing_doc if existing_doc else sigtext
+ msg = sigtext + "\n\n" + existing_doc if check_string_type(existing_doc) else sigtext
return msg
# end of file