summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-12 19:58:41 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-12 19:58:41 (GMT)
commit8750384dbc9ceeaab754e9738f0c5150e7c847eb (patch)
treea78007af73358765eea8edda10426529b95b3a96 /Lib/ctypes
parentd660fabd24dfd48df43bc0717cfec44385ae736e (diff)
downloadcpython-8750384dbc9ceeaab754e9738f0c5150e7c847eb.zip
cpython-8750384dbc9ceeaab754e9738f0c5150e7c847eb.tar.gz
cpython-8750384dbc9ceeaab754e9738f0c5150e7c847eb.tar.bz2
More easy fixes. The ctypes unittests pass now (on Windows).
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/test/test_functions.py2
-rw-r--r--Lib/ctypes/test/test_python_api.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ctypes/test/test_functions.py b/Lib/ctypes/test/test_functions.py
index 0d0b56f..0cca861 100644
--- a/Lib/ctypes/test/test_functions.py
+++ b/Lib/ctypes/test/test_functions.py
@@ -166,7 +166,7 @@ class FunctionTestCase(unittest.TestCase):
f = dll._testfunc_p_p
f.argtypes = None
f.restype = c_char_p
- result = f("123")
+ result = f(b"123")
self.failUnlessEqual(result, "123")
result = f(None)
diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/ctypes/test/test_python_api.py
index f267413..8348c8b 100644
--- a/Lib/ctypes/test/test_python_api.py
+++ b/Lib/ctypes/test/test_python_api.py
@@ -74,11 +74,11 @@ class PythonAPITestCase(unittest.TestCase):
PyOS_snprintf.argtypes = POINTER(c_char), c_size_t, c_char_p
buf = c_buffer(256)
- PyOS_snprintf(buf, sizeof(buf), "Hello from %s", "ctypes")
+ PyOS_snprintf(buf, sizeof(buf), "Hello from %s", b"ctypes")
self.failUnlessEqual(buf.value, "Hello from ctypes")
- PyOS_snprintf(buf, sizeof(buf), "Hello from %s (%d, %d, %d)", "ctypes", 1, 2, 3)
- self.failUnlessEqual(buf.value, "Hello from ctypes")
+ PyOS_snprintf(buf, sizeof(buf), "Hello from %s (%d, %d, %d)", b"ctypes", 1, 2, 3)
+ self.failUnlessEqual(buf.value, "Hello from ctypes (1, 2, 3)")
# not enough arguments
self.failUnlessRaises(TypeError, PyOS_snprintf, buf)