# and the ansi escape to return to normal text
if not just_prompt and prepend_padding:
if not self.output_queue \
- or not self.output_queue[-1].endswith("\r\n"):
+ or not self.output_queue[-1].endswith(b"\r\n"):
output = "$(eol)" + output
elif not self.output_queue[-1].endswith(
- "\r\n\x1b[0m\r\n"
+ b"\r\n\x1b[0m\r\n"
) and not self.output_queue[-1].endswith(
- "\r\n\r\n"
+ b"\r\n\r\n"
):
output = "$(eol)" + output
output += eol + chr(27) + "[0m"
escape = False
# normalize any potentially composited unicode before we count it
- text = unicodedata.normalize("NFKC", text)
+ # TODO: remove this check after the switch to py3k
+ try:
+ text = unicodedata.normalize("NFKC", text)
+ except TypeError:
+ text = unicodedata.normalize("NFKC", unicode(text))
# iterate over each character from the begining of the text
for each_character in text: