mirror of
https://github.com/hassio-addons/docker-context-streamer.git
synced 2025-05-07 04:11:24 +00:00
🐛 Fix Python 2 compatibility
This commit is contained in:
parent
2fda17f49d
commit
82b9681ea2
1 changed files with 4 additions and 1 deletions
|
@ -65,7 +65,10 @@ class Streamer(object):
|
|||
|
||||
def stream_context(self):
|
||||
"""Start streaming the tar context for Docker."""
|
||||
with TarFile.open(mode='w|', fileobj=sys.stdout.buffer) as tarfile:
|
||||
with TarFile.open(
|
||||
mode='w|',
|
||||
fileobj=getattr(sys.stdout, 'buffer', sys.stdout)
|
||||
) as tarfile:
|
||||
|
||||
tarfile.add(
|
||||
self.context,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue