diff options
author | Thomas Heller <theller@ctypes.org> | 2007-07-11 13:50:53 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2007-07-11 13:50:53 (GMT) |
commit | 13eb6cad7e67ed47261505dc853e2ad7dbf527af (patch) | |
tree | 4fc1b96d12199667b8e41ef5155200f08ffad2ee | |
parent | 992d4a3e6e67a05b85350820157028a61d1f22cf (diff) | |
download | cpython-13eb6cad7e67ed47261505dc853e2ad7dbf527af.zip cpython-13eb6cad7e67ed47261505dc853e2ad7dbf527af.tar.gz cpython-13eb6cad7e67ed47261505dc853e2ad7dbf527af.tar.bz2 |
Fix some more ctypes tests.
-rw-r--r-- | Lib/ctypes/test/test_cast.py | 8 | ||||
-rw-r--r-- | 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 7371b0f..cafb697 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 04b2040..509d2c4 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 |