diff --git a/pyreadline/console/console.py b/pyreadline/console/console.py index 9487b88..84e65f6 100644 --- a/pyreadline/console/console.py +++ b/pyreadline/console/console.py @@ -289,7 +289,7 @@ class Console(object): # This pattern should match all characters that change the cursor position differently # than a normal character. - motion_char_re = re.compile(u'([\n\r\t\010\007])') + motion_char_re = re.compile('([\n\r\t\010\007])'.encode('ascii')) def write_scrolling(self, text, attr=None): u'''write text at current cursor position while watching for scrolling. @@ -309,7 +309,7 @@ class Console(object): w, h = self.size() scroll = 0 # the result # split the string into ordinary characters and funny characters - chunks = self.motion_char_re.split(text) + chunks = self.motion_char_re.split(ensure_str(text)) for chunk in chunks: n = self.write_color(chunk, attr) if len(chunk) == 1: # the funny characters will be alone