diff options
author | Corentin Henry <corentinhenry@gmail.com> | 2018-11-28 14:32:12 -0800 |
---|---|---|
committer | Corentin Henry <corentinhenry@gmail.com> | 2018-11-28 15:16:23 -0800 |
commit | 7b3b83dfdbb9f4270dcf54e1449645efc045dfd3 (patch) | |
tree | 67261c3663b12e12b87832d553fdf211a930b0dd /docker/utils | |
parent | 41c0eb7e804ef428da27509714df34d26a56b9a6 (diff) | |
download | docker-py-7b3b83dfdbb9f4270dcf54e1449645efc045dfd3.tar.gz |
fix exec api inconsistency
Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
Diffstat (limited to 'docker/utils')
-rw-r--r-- | docker/utils/socket.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/docker/utils/socket.py b/docker/utils/socket.py index 4b32853..7ba9505 100644 --- a/docker/utils/socket.py +++ b/docker/utils/socket.py @@ -138,15 +138,21 @@ def consume_socket_output(frames, demux=False): # If the streams are demultiplexed, the generator yields tuples # (stdout, stderr) - out = [six.binary_type(), six.binary_type()] + out = [None, None] for frame in frames: # It is guaranteed that for each frame, one and only one stream # is not None. assert frame != (None, None) if frame[0] is not None: - out[0] += frame[0] + if out[0] is None: + out[0] = frame[0] + else: + out[0] += frame[0] else: - out[1] += frame[1] + if out[1] is None: + out[1] = frame[1] + else: + out[1] += frame[1] return tuple(out) |