diff --git a/Tests/test_image_getim.py b/Tests/test_image_getim.py index e83439789..ab0ec781c 100644 --- a/Tests/test_image_getim.py +++ b/Tests/test_image_getim.py @@ -10,7 +10,14 @@ class TestImageGetIm(PillowTestCase): if py3: self.assertIn("PyCapsule", type_repr) - self.assertIsInstance(im.im.id, int) + + try: + #py2.6 + target_types = (int, long) + except: + target_types = (int) + + self.assertIsInstance(im.im.id, target_types) if __name__ == '__main__': diff --git a/Tests/test_imagewin_pointers.py b/Tests/test_imagewin_pointers.py index bf7f4bb7c..05af24acb 100644 --- a/Tests/test_imagewin_pointers.py +++ b/Tests/test_imagewin_pointers.py @@ -72,7 +72,11 @@ if sys.platform.startswith('win32'): memcpy(bp, ctypes.byref(bf), ctypes.sizeof(bf)) memcpy(bp + ctypes.sizeof(bf), ctypes.byref(bi), bi.biSize) memcpy(bp + bf.bfOffBits, pixels, bi.biSizeImage) - return bytearray(buf) + try: + return bytearray(buf) + except: + # py2.6 + return buffer(buf)[:] class TestImageWinPointers(PillowTestCase): def test_pointer(self):