Author: Antonio Cuni <[email protected]>
Branch: py3k-readline
Changeset: r193:9334769ae08f
Date: 2012-05-04 17:22 +0200
http://bitbucket.org/pypy/pyrepl/changeset/9334769ae08f/

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

diff --git a/pyrepl/simple_interact.py b/pyrepl/simple_interact.py
--- a/pyrepl/simple_interact.py
+++ b/pyrepl/simple_interact.py
@@ -33,6 +33,7 @@
         return False
     return True
 
+
 def run_multiline_interactive_console(mainmodule=None):
     import code
     import __main__
@@ -41,7 +42,10 @@
 
     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
         try:
             code = console.compile(src, '<input>', 'single')
         except (OverflowError, SyntaxError, ValueError):
diff --git a/pyrepl/unix_eventqueue.py b/pyrepl/unix_eventqueue.py
--- a/pyrepl/unix_eventqueue.py
+++ b/pyrepl/unix_eventqueue.py
@@ -98,7 +98,7 @@
         self.events.append(event)
 
     def push(self, char):
-        self.buf.append(char)
+        self.buf.append(ord(char))
         if char in self.k:
             if self.k is self.ck:
                 #sanity check, buffer is empty when a special key comes
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to