summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-11 00:26:17 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-11 00:26:17 (GMT)
commit51bff5da8aaefd2f86b25b3d78aa7a53797eb2a7 (patch)
tree2c7c0c2eb6fffc48a941eb631a95ae1f25097a60 /Lib
parenta083f1eb5f436c0f0efda358590fadf88ea3126c (diff)
downloadcpython-51bff5da8aaefd2f86b25b3d78aa7a53797eb2a7.zip
cpython-51bff5da8aaefd2f86b25b3d78aa7a53797eb2a7.tar.gz
cpython-51bff5da8aaefd2f86b25b3d78aa7a53797eb2a7.tar.bz2
Correct a test_ctypes failure, caused by the removal of memoryview.size.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_pep3118.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ctypes/test/test_pep3118.py b/Lib/ctypes/test/test_pep3118.py
index 7a77f4c..bdcf3ec 100644
--- a/Lib/ctypes/test/test_pep3118.py
+++ b/Lib/ctypes/test/test_pep3118.py
@@ -25,7 +25,7 @@ class Test(unittest.TestCase):
v = memoryview(ob)
try:
self.failUnlessEqual(normalize(v.format), normalize(fmt))
- self.failUnlessEqual(v.size, sizeof(ob))
+ self.failUnlessEqual(len(v), sizeof(ob))
self.failUnlessEqual(v.itemsize, sizeof(itemtp))
self.failUnlessEqual(v.shape, shape)
# ctypes object always have a non-strided memory block
@@ -37,7 +37,7 @@ class Test(unittest.TestCase):
n = 1
for dim in v.shape:
n = n * dim
- self.failUnlessEqual(v.itemsize * n, v.size)
+ self.failUnlessEqual(v.itemsize * n, len(v))
except:
# so that we can see the failing type
print(tp)
@@ -49,7 +49,7 @@ class Test(unittest.TestCase):
v = memoryview(ob)
try:
self.failUnlessEqual(v.format, fmt)
- self.failUnlessEqual(v.size, sizeof(ob))
+ self.failUnlessEqual(len(v), sizeof(ob))
self.failUnlessEqual(v.itemsize, sizeof(itemtp))
self.failUnlessEqual(v.shape, shape)
# ctypes object always have a non-strided memory block
@@ -61,7 +61,7 @@ class Test(unittest.TestCase):
n = 1
for dim in v.shape:
n = n * dim
- self.failUnlessEqual(v.itemsize * n, v.size)
+ self.failUnlessEqual(v.itemsize * n, len(v))
except:
# so that we can see the failing type
print(tp)