diff options
| -rw-r--r-- | meta/classes/devshell.bbclass | 4 | ||||
| -rwxr-xr-x | scripts/oepydevshell-internal.py | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass index 041ed15d46..be71aff35f 100644 --- a/meta/classes/devshell.bbclass +++ b/meta/classes/devshell.bbclass | |||
| @@ -65,8 +65,6 @@ def devpyshell(d): | |||
| 65 | os.dup2(m, sys.stdout.fileno()) | 65 | os.dup2(m, sys.stdout.fileno()) |
| 66 | os.dup2(m, sys.stderr.fileno()) | 66 | os.dup2(m, sys.stderr.fileno()) |
| 67 | 67 | ||
| 68 | sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0) | ||
| 69 | |||
| 70 | bb.utils.nonblockingfd(sys.stdout) | 68 | bb.utils.nonblockingfd(sys.stdout) |
| 71 | bb.utils.nonblockingfd(sys.stderr) | 69 | bb.utils.nonblockingfd(sys.stderr) |
| 72 | bb.utils.nonblockingfd(sys.stdin) | 70 | bb.utils.nonblockingfd(sys.stdin) |
| @@ -92,6 +90,7 @@ def devpyshell(d): | |||
| 92 | else: | 90 | else: |
| 93 | prompt = ps1 | 91 | prompt = ps1 |
| 94 | sys.stdout.write(prompt) | 92 | sys.stdout.write(prompt) |
| 93 | sys.stdout.flush() | ||
| 95 | 94 | ||
| 96 | # Restore Ctrl+C since bitbake masks this | 95 | # Restore Ctrl+C since bitbake masks this |
| 97 | def signal_handler(signal, frame): | 96 | def signal_handler(signal, frame): |
| @@ -113,6 +112,7 @@ def devpyshell(d): | |||
| 113 | continue | 112 | continue |
| 114 | except EOFError as e: | 113 | except EOFError as e: |
| 115 | sys.stdout.write("\n") | 114 | sys.stdout.write("\n") |
| 115 | sys.stdout.flush() | ||
| 116 | except (OSError, IOError) as e: | 116 | except (OSError, IOError) as e: |
| 117 | if e.errno == 11: | 117 | if e.errno == 11: |
| 118 | continue | 118 | continue |
diff --git a/scripts/oepydevshell-internal.py b/scripts/oepydevshell-internal.py index 7761f667ef..31a75ac29f 100755 --- a/scripts/oepydevshell-internal.py +++ b/scripts/oepydevshell-internal.py | |||
| @@ -29,9 +29,6 @@ if len(sys.argv) != 3: | |||
| 29 | pty = open(sys.argv[1], "w+b", 0) | 29 | pty = open(sys.argv[1], "w+b", 0) |
| 30 | parent = int(sys.argv[2]) | 30 | parent = int(sys.argv[2]) |
| 31 | 31 | ||
| 32 | # Don't buffer output by line endings | ||
| 33 | sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | ||
| 34 | sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0) | ||
| 35 | nonblockingfd(pty) | 32 | nonblockingfd(pty) |
| 36 | nonblockingfd(sys.stdin) | 33 | nonblockingfd(sys.stdin) |
| 37 | 34 | ||
| @@ -64,6 +61,7 @@ try: | |||
| 64 | # Write a page at a time to avoid overflowing output | 61 | # Write a page at a time to avoid overflowing output |
| 65 | # d.keys() is a good way to do that | 62 | # d.keys() is a good way to do that |
| 66 | sys.stdout.write(i[:4096]) | 63 | sys.stdout.write(i[:4096]) |
| 64 | sys.stdout.flush() | ||
| 67 | i = i[4096:] | 65 | i = i[4096:] |
| 68 | if sys.stdin in ready: | 66 | if sys.stdin in ready: |
| 69 | echonocbreak(sys.stdin.fileno()) | 67 | echonocbreak(sys.stdin.fileno()) |
