And now for something completely different. Py3 compatibility

This commit is contained in:
wiredfool 2014-07-23 09:08:28 -07:00
parent 67c235b7c0
commit e14e3593d9

View File

@ -65,8 +65,10 @@ class TestFormatHSV(PillowTestCase):
converted = [self.tuple_to_ints(func(conv_func(_r), conv_func(_g), conv_func(_b)))
for (_r, _g, _b) in iter_helper(r.tobytes(), g.tobytes(), b.tobytes())]
new_bytes = b''.join(chr(h)+chr(s)+chr(v) for (h,s,v) in converted)
if str is bytes:
new_bytes = b''.join(chr(h)+chr(s)+chr(v) for (h,s,v) in converted)
else:
new_bytes = b''.join(bytes(chr(h)+chr(s)+chr(v), 'latin-1') for (h,s,v) in converted)
hsv = Image.frombytes(mode,r.size, new_bytes)