From e14e3593d98056fb86811e4613f221009320d5fe Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 23 Jul 2014 09:08:28 -0700 Subject: [PATCH] And now for something completely different. Py3 compatibility --- Tests/test_format_hsv.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/test_format_hsv.py b/Tests/test_format_hsv.py index be9c86e1c..03603aa9b 100644 --- a/Tests/test_format_hsv.py +++ b/Tests/test_format_hsv.py @@ -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)