Merge "Add comment about workaround for py3"

This commit is contained in:
Jenkins
2016-07-20 10:53:57 +00:00
committed by Gerrit Code Review

View File

@@ -283,6 +283,8 @@ def save_image(data, path):
:param path: path to save the image to
"""
if path is None:
# NOTE(kragniz): for py3 compatibility: sys.stdout.buffer is only
# present on py3, otherwise fall back to sys.stdout
image = getattr(sys.stdout, 'buffer',
sys.stdout)
else: