Skip to content

Commit d0985b0

Browse files
Ensure that stream=True is passed to requests when version >= 1.8
1 parent 7ea1195 commit d0985b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docker/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ def build(self, path=None, tag=None, quiet=False, fileobj=None,
349349
else:
350350
context = utils.tar(path)
351351

352+
if utils.compare_version('1.8', self._version) >= 0:
353+
stream = True
354+
352355
u = self._url('/build')
353356
params = {
354357
't': tag,
@@ -372,7 +375,7 @@ def build(self, path=None, tag=None, quiet=False, fileobj=None,
372375
if context is not None:
373376
context.close()
374377

375-
if stream or utils.compare_version('1.8', self._version) >= 0:
378+
if stream:
376379
return self._stream_helper(response)
377380
else:
378381
output = self._result(response)

0 commit comments

Comments
 (0)