Commits

Amaury Forgeot d'Arc committed 8753130

Correct a test_ctypes failure, caused by the removal of memoryview.size.

  • Participants
  • Parent commits 51ff934

Comments (0)

Files changed (1)

File Lib/ctypes/test/test_pep3118.py

             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
                     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)
             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
                     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)