def _proc_iteroutput_select(proc):
from six.moves import zip_longest<EOL>while proc.poll() is None:<EOL><INDENT>reads = [proc.stdout.fileno(), proc.stderr.fileno()]<EOL>ret = select.select(reads, [], [])<EOL>oline = eline = None<EOL>for fd in ret[<NUM_LIT:0>]:<EOL><INDENT>if fd == proc.stdout.fileno():<EOL><INDENT>oline = proc.stdout.readline()<EOL><DEDENT>if fd == proc.stderr.fileno():<EOL><INDENT>eline = proc.stderr.readline()<EOL><DEDENT><DEDENT>yield oline, eline<EOL><DEDENT>oline_iter = _textio_iterlines(proc.stdout)<EOL>eline_iter = _textio_iterlines(proc.stderr)<EOL>for oline, eline in zip_longest(oline_iter, eline_iter):<EOL><INDENT>yield oline, eline<EOL><DEDENT>
Iterates over output from a process line by line

UNIX only. Use `_proc_iteroutput_thread` instead for a cross platform
solution based on threads.

Yields:
    Tuple[str, str]: oline, eline: stdout and stderr line