logic seemed to be broken (only filter out strings which have a 'strip'
attribute string in python 3 have both attributes, '__iter__' and '__getitem'. Old syntax therefore split up strings into characters
This commit is contained in:
parent
beb418eb44
commit
6dd970dfe0
|
@ -36,8 +36,8 @@ class bcolors:
|
||||||
def srepr(arg,glue = '\n'):
|
def srepr(arg,glue = '\n'):
|
||||||
"""Joins arguments as individual lines"""
|
"""Joins arguments as individual lines"""
|
||||||
if (not hasattr(arg, "strip") and
|
if (not hasattr(arg, "strip") and
|
||||||
hasattr(arg, "__getitem__") or
|
(hasattr(arg, "__getitem__") or
|
||||||
hasattr(arg, "__iter__")):
|
hasattr(arg, "__iter__"))):
|
||||||
return glue.join(str(x) for x in arg)
|
return glue.join(str(x) for x in arg)
|
||||||
return arg if isinstance(arg,str) else repr(arg)
|
return arg if isinstance(arg,str) else repr(arg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue