Antonio Cuni  committed 9334769

bytearray does not support bytes char in py3k. And no need for the utf-8 hack

  • Participants
  • Parent commits 08d1c1a
  • Branches py3k-readline

Comments (0)

Files changed (2)

File pyrepl/

         return False
     return True
 def run_multiline_interactive_console(mainmodule=None):
     import code
     import __main__
     def more_lines(unicodetext):
         # ooh, look at the hack:
-        src = "#coding:utf-8\n"+unicodetext.encode('utf-8')
+        if sys.version_info < (3,):
+            src = "#coding:utf-8\n"+unicodetext.encode('utf-8')
+        else:
+            src = unicodetext
             code = console.compile(src, '<input>', 'single')
         except (OverflowError, SyntaxError, ValueError):

File pyrepl/

     def push(self, char):
-        self.buf.append(char)
+        self.buf.append(ord(char))
         if char in self.k:
             if self.k is
                 #sanity check, buffer is empty when a special key comes