diff options
Diffstat (limited to 'scripts/oepydevshell-internal.py')
-rwxr-xr-x | scripts/oepydevshell-internal.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/oepydevshell-internal.py b/scripts/oepydevshell-internal.py index 31a75ac29f..a22bec3365 100755 --- a/scripts/oepydevshell-internal.py +++ b/scripts/oepydevshell-internal.py | |||
@@ -47,7 +47,7 @@ try: | |||
47 | # Need cbreak/noecho whilst in select so we trigger on any keypress | 47 | # Need cbreak/noecho whilst in select so we trigger on any keypress |
48 | cbreaknoecho(sys.stdin.fileno()) | 48 | cbreaknoecho(sys.stdin.fileno()) |
49 | # Send our PID to the other end so they can kill us. | 49 | # Send our PID to the other end so they can kill us. |
50 | pty.write(str(os.getpid()) + "\n") | 50 | pty.write(str(os.getpid()).encode('utf-8') + b"\n") |
51 | while True: | 51 | while True: |
52 | try: | 52 | try: |
53 | writers = [] | 53 | writers = [] |
@@ -56,7 +56,7 @@ try: | |||
56 | (ready, _, _) = select.select([pty, sys.stdin], writers , [], 0) | 56 | (ready, _, _) = select.select([pty, sys.stdin], writers , [], 0) |
57 | try: | 57 | try: |
58 | if pty in ready: | 58 | if pty in ready: |
59 | i = i + pty.read() | 59 | i = i + pty.read().decode('utf-8') |
60 | if i: | 60 | if i: |
61 | # Write a page at a time to avoid overflowing output | 61 | # Write a page at a time to avoid overflowing output |
62 | # d.keys() is a good way to do that | 62 | # d.keys() is a good way to do that |
@@ -65,9 +65,9 @@ try: | |||
65 | i = i[4096:] | 65 | i = i[4096:] |
66 | if sys.stdin in ready: | 66 | if sys.stdin in ready: |
67 | echonocbreak(sys.stdin.fileno()) | 67 | echonocbreak(sys.stdin.fileno()) |
68 | o = input() | 68 | o = input().encode('utf-8') |
69 | cbreaknoecho(sys.stdin.fileno()) | 69 | cbreaknoecho(sys.stdin.fileno()) |
70 | pty.write(o + "\n") | 70 | pty.write(o + b"\n") |
71 | except (IOError, OSError) as e: | 71 | except (IOError, OSError) as e: |
72 | if e.errno == 11: | 72 | if e.errno == 11: |
73 | continue | 73 | continue |