From: Chris Johns <chr...@rtems.org> - Use the 'read1' file handle call to return if any data is queued for reading from stdout or stderr. - Flush the stdin pipe in the writer thread.
These changes let the execute module work on Python2 and Python3. --- rtemstoolkit/execute.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtemstoolkit/execute.py b/rtemstoolkit/execute.py index eb3c8c2..9fdc581 100755 --- a/rtemstoolkit/execute.py +++ b/rtemstoolkit/execute.py @@ -148,6 +148,7 @@ class execute(object): if encoding: lines = bytes(lines, sys.stdin.encoding) fh.write(lines) + fh.flush() except: break if lines == None or \ @@ -193,7 +194,7 @@ class execute(object): # and the process is shutting down. # try: - data = fh.read(4096) + data = fh.read1(4096) except: data = '' if len(data) == 0: -- 2.14.1 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel