Skip to content

Commit dc210b8

Browse files
committed
Only call decode if Python 3.x
1 parent 7e600a3 commit dc210b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docker/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def _stream_helper(self, response, decode=False):
169169
if reader._fp.chunk_left:
170170
data += reader.read(reader._fp.chunk_left)
171171
if decode:
172-
data = json.loads(data.decode('utf-8'))
172+
if six.PY3:
173+
data = data.decode('utf-8')
174+
data = json.loads(data)
173175
yield data
174176
else:
175177
# Response isn't chunked, meaning we probably

0 commit comments

Comments
 (0)