From 13eb6cad7e67ed47261505dc853e2ad7dbf527af Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Wed, 11 Jul 2007 13:50:53 +0000 Subject: [PATCH] Fix some more ctypes tests. --- Lib/ctypes/test/test_cast.py | 8 ++++---- Lib/ctypes/test/test_internals.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/ctypes/test/test_cast.py b/Lib/ctypes/test/test_cast.py index 7371b0fe24b..cafb6971a7e 100644 --- a/Lib/ctypes/test/test_cast.py +++ b/Lib/ctypes/test/test_cast.py @@ -34,17 +34,17 @@ class Test(unittest.TestCase): array = (c_char_p * 5)() self.failUnlessEqual(array._objects, None) array[0] = "foo bar" - self.failUnlessEqual(array._objects, {'0': "foo bar"}) + self.failUnlessEqual(array._objects, {'0': b"foo bar"}) p = cast(array, POINTER(c_char_p)) # array and p share a common _objects attribute self.failUnless(p._objects is array._objects) - self.failUnlessEqual(array._objects, {'0': "foo bar", id(array): array}) + self.failUnlessEqual(array._objects, {'0': b"foo bar", id(array): array}) p[0] = "spam spam" - self.failUnlessEqual(p._objects, {'0': "spam spam", id(array): array}) + self.failUnlessEqual(p._objects, {'0': b"spam spam", id(array): array}) self.failUnless(array._objects is p._objects) p[1] = "foo bar" - self.failUnlessEqual(p._objects, {'1': 'foo bar', '0': "spam spam", id(array): array}) + self.failUnlessEqual(p._objects, {'1': b'foo bar', '0': b"spam spam", id(array): array}) self.failUnless(array._objects is p._objects) def test_other(self): diff --git a/Lib/ctypes/test/test_internals.py b/Lib/ctypes/test/test_internals.py index 04b20403982..509d2c434e5 100644 --- a/Lib/ctypes/test/test_internals.py +++ b/Lib/ctypes/test/test_internals.py @@ -76,11 +76,11 @@ class ObjectsTestCase(unittest.TestCase): x = X() x.a = s1 x.b = s2 - self.failUnlessEqual(x._objects, {"0": s1, "1": s2}) + self.failUnlessEqual(x._objects, {"0": bytes(s1), "1": bytes(s2)}) y = Y() y.x = x - self.failUnlessEqual(y._objects, {"0": {"0": s1, "1": s2}}) + self.failUnlessEqual(y._objects, {"0": {"0": bytes(s1), "1": bytes(s2)}}) ## x = y.x ## del y ## print x._b_base_._objects