File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1616from bpython import translations
1717translations .init ()
1818from bpython .translations import _
19+ from bpython ._py3compat import py3
1920
2021from fmtstr .fsarray import FSArray
2122from fmtstr .fmtstr import fmtstr , FmtStr
4243#TODO proper raw_input (currently input isn't visible while typing, includes \r, and comes in as unicode in Python 2
4344#TODO use events instead of length-one queues for interthread communication
4445
45- #TODO raw_input should be bytes in python2
4646#TODO check py3 compatibility
4747
4848
@@ -65,8 +65,9 @@ def process_event(self, e):
6565 #TODO EOF on ctrl-d
6666 else : # add normal character
6767 logging .debug ('adding normal char %r to current line' , e )
68+ c = e if py3 else e .encode ('utf8' )
6869 self .current_line = (self .current_line [:self .cursor_offset_in_line ] +
69- e +
70+ c +
7071 self .current_line [self .cursor_offset_in_line :])
7172 self .cursor_offset_in_line += 1
7273
You can’t perform that action at this time.
0 commit comments