mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Fixing the tests on py 3.x
This commit is contained in:
parent
c6ec3be0d6
commit
f65fcf7274
|
@ -1,6 +1,6 @@
|
||||||
from helper import unittest, PillowTestCase
|
from helper import unittest, PillowTestCase
|
||||||
|
|
||||||
from PIL import ImagePath
|
from PIL import ImagePath, Image
|
||||||
|
|
||||||
import array
|
import array
|
||||||
import struct
|
import struct
|
||||||
|
@ -69,18 +69,21 @@ class TestImagePath(PillowTestCase):
|
||||||
|
|
||||||
# This fails due to the invalid malloc above,
|
# This fails due to the invalid malloc above,
|
||||||
# and segfaults
|
# and segfaults
|
||||||
for i in xrange(200000):
|
for i in range(200000):
|
||||||
x[i] = "0"*16
|
if str is bytes:
|
||||||
|
x[i] = "0"*16
|
||||||
|
else:
|
||||||
|
x[i] = b'0'*16
|
||||||
|
|
||||||
except MemoryError as msg:
|
except MemoryError as msg:
|
||||||
self.assertTrue(msg)
|
self.assertTrue(msg)
|
||||||
except:
|
except:
|
||||||
self.asserTrue(False, "Should have received a memory error")
|
self.assertTrue(False, "Should have received a memory error")
|
||||||
|
|
||||||
|
|
||||||
class evil:
|
class evil:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.corrupt = ImagePath.Path(0x4000000000000000)
|
self.corrupt = Image.core.path(0x4000000000000000)
|
||||||
|
|
||||||
def __getitem__(self, i):
|
def __getitem__(self, i):
|
||||||
x = self.corrupt[i]
|
x = self.corrupt[i]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user