]> granicus.if.org Git - python/commitdiff
Make the test somewhat clearer (I hope).
authorThomas Heller <theller@ctypes.org>
Wed, 13 Feb 2008 20:36:51 +0000 (20:36 +0000)
committerThomas Heller <theller@ctypes.org>
Wed, 13 Feb 2008 20:36:51 +0000 (20:36 +0000)
Lib/ctypes/test/test_pickling.py

index 53557951e6e9c228418d826fa6f84d8334881dd9..c7925c7ac783d2a951f49126f76a1b8fb5dbf956 100644 (file)
@@ -28,8 +28,8 @@ class PickleTest(unittest.TestCase):
             ]:
             dst = self.loads(self.dumps(src))
             self.failUnlessEqual(src.__dict__, dst.__dict__)
-            self.failUnlessEqual(buffer(src),
-                                 buffer(dst))
+            self.failUnlessEqual(buffer(src)[:],
+                                 buffer(dst)[:])
 
     def test_struct(self):
         X.init_called = 0
@@ -46,8 +46,8 @@ class PickleTest(unittest.TestCase):
         # ctypes instances are identical when the instance __dict__
         # and the memory buffer are identical
         self.failUnlessEqual(y.__dict__, x.__dict__)
-        self.failUnlessEqual(buffer(y),
-                             buffer(x))
+        self.failUnlessEqual(buffer(y)[:],
+                             buffer(x)[:])
 
     def test_unpickable(self):
         # ctypes objects that are pointers or contain pointers are