Add comment about workaround for py3

Change-Id: Ibe8720c14e8ec401bc0d595915cbb962f4021bcb
This commit is contained in:
Louis Taylor
2016-07-13 15:18:07 +00:00
parent 7ed22a91d3
commit 3047afb121

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: