fkie_node_manager: fixed compatibility of echo dialog to python 3
@@ -691,12 +691,18 @@ class EchoDialog(QDialog):
:returns: string (YAML) representation of message, ``str``
"""
type_ = type(val)
- if type_ in (int, long, float) and fixed_numeric_width is not None:
+ if sys.version_info[0] <= 2:
+ types = (int, long, float)
+ types_wb = (int, long, float, bool)
+ else:
+ types = (int, float)
+ types_wb = (int, float, bool)
+ if type_ in types and fixed_numeric_width is not None:
if type_ is float:
return ('%.' + str(fixed_numeric_width) + 'f') % val
else:
return ('%d') % val
- elif type_ in (int, long, float, bool):
+ elif type_ in types_wb:
return utf8(val)
elif isstring(val):
# TODO: need to escape strings correctly
