Utility to demultiplex stdout and stderr when reading frames from the socket.
(stream_id, data)
| 175 | |
| 176 | |
| 177 | def demux_adaptor(stream_id, data): |
| 178 | """ |
| 179 | Utility to demultiplex stdout and stderr when reading frames from the |
| 180 | socket. |
| 181 | """ |
| 182 | if stream_id == STDOUT: |
| 183 | return (data, None) |
| 184 | elif stream_id == STDERR: |
| 185 | return (None, data) |
| 186 | else: |
| 187 | raise ValueError(f'{stream_id} is not a valid stream') |