Changeset af5cecf in rtems-tools


Ignore:
Timestamp:
Nov 25, 2018, 11:01:53 PM (6 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
29f9e10
Parents:
71cede0
git-author:
Chris Johns <chrisj@…> (11/25/18 23:01:53)
git-committer:
Chris Johns <chrisj@…> (11/26/18 03:36:44)
Message:

rtemstoolkit: Fixes to the reader and writer threads for capturing

  • 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemstoolkit/execute.py

    r71cede0 raf5cecf  
    149149                                lines = bytes(lines, sys.stdin.encoding)
    150150                            fh.write(lines)
     151                            fh.flush()
    151152                        except:
    152153                            break
     
    194195                    #
    195196                    try:
    196                         data = fh.read(4096)
     197                        data = fh.read1(4096)
    197198                    except:
    198199                        data = ''
    199200                    if len(data) == 0:
    200201                        if len(line) > 0:
    201                             _output_line(l + '\n', exe, prefix, out, count)
     202                            _output_line(line + '\n', exe, prefix, out, count)
    202203                        break
    203204                    # str and bytes are the same type in Python2
Note: See TracChangeset for help on using the changeset viewer.