Resolves #466. Items that are not strings are converted into strings before being turned into ANSIStrings.

This commit is contained in:
Kelketek Rritaa 2014-01-30 20:40:44 -06:00
parent 382bf01bef
commit f446a74c28

View file

@ -356,6 +356,8 @@ class ANSIString(unicode):
decode strings, as escapes can only be respected once.
"""
string = args[0]
if not isinstance(string, basestring):
string = str(string)
args = args[1:]
parser = kwargs.get('parser', ANSI_PARSER)
decoded = kwargs.get('decoded', False) or hasattr(string, 'raw_string')