]> granicus.if.org Git - python/commitdiff
More easy fixes. The ctypes unittests pass now (on Windows).
authorThomas Heller <theller@ctypes.org>
Thu, 12 Jul 2007 19:58:41 +0000 (19:58 +0000)
committerThomas Heller <theller@ctypes.org>
Thu, 12 Jul 2007 19:58:41 +0000 (19:58 +0000)
Lib/ctypes/test/test_functions.py
Lib/ctypes/test/test_python_api.py

index 0d0b56fd74cb1872c8df08196cd936536b997938..0cca8619a3adeea60b5233611f15380bae9a0099 100644 (file)
@@ -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)
index f267413dd6f5cb2cf35fbf38c4c8d3abfc25e573..8348c8b66fd980541a25dd6e0c1c982e14254f29 100644 (file)
@@ -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)