summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes/test
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-12 19:33:24 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-12 19:33:24 (GMT)
commit3d79dd9edf3cfdffd1dc7d4e45b77da2478e1111 (patch)
tree3aa3b3524b83c1467ba9000fbc1b5bb6d158d14e /Lib/ctypes/test
parent7a76e8f67c0866d04c7370df580bcd7b0cb42297 (diff)
downloadcpython-3d79dd9edf3cfdffd1dc7d4e45b77da2478e1111.zip
cpython-3d79dd9edf3cfdffd1dc7d4e45b77da2478e1111.tar.gz
cpython-3d79dd9edf3cfdffd1dc7d4e45b77da2478e1111.tar.bz2
c_char_p.from_param accepts bytes. Fix test_parameters.
Diffstat (limited to 'Lib/ctypes/test')
-rw-r--r--Lib/ctypes/test/test_parameters.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
index 84d8eaf..4c80bdf 100644
--- a/Lib/ctypes/test/test_parameters.py
+++ b/Lib/ctypes/test/test_parameters.py
@@ -54,11 +54,11 @@ class SimpleTypesTestCase(unittest.TestCase):
# c_char_p.from_param on a Python String packs the string
# into a cparam object
- s = "123"
+ s = b"123"
self.failUnless(c_char_p.from_param(s)._obj is s)
# new in 0.9.1: convert (encode) unicode to ascii
- self.failUnlessEqual(c_char_p.from_param("123")._obj, "123")
+ self.failUnlessEqual(c_char_p.from_param("123")._obj, b"123")
self.assertRaises(UnicodeEncodeError, c_char_p.from_param, "123\377")
self.assertRaises(TypeError, c_char_p.from_param, 42)
@@ -82,7 +82,7 @@ class SimpleTypesTestCase(unittest.TestCase):
# new in 0.9.1: convert (decode) ascii to unicode
self.failUnlessEqual(c_wchar_p.from_param("123")._obj, "123")
- self.assertRaises(UnicodeDecodeError, c_wchar_p.from_param, "123\377")
+ self.assertRaises(UnicodeDecodeError, c_wchar_p.from_param, b"123\377")
pa = c_wchar_p.from_param(c_wchar_p("123"))
self.failUnlessEqual(type(pa), c_wchar_p)