Merge "Fix image-download to stdout on Python 3.x"

This commit is contained in:
Jenkins
2015-12-22 13:24:22 +00:00
committed by Gerrit Code Review

View File

@@ -298,7 +298,10 @@ def save_image(data, path):
:param path: path to save the image to
"""
if path is None:
image = sys.stdout
if six.PY3:
image = sys.stdout.buffer
else:
image = sys.stdout
else:
image = open(path, 'wb')
try: