diff options
-rw-r--r-- | Lib/ctypes/test/test_functions.py | 2 | ||||
-rw-r--r-- | Lib/ctypes/test/test_python_api.py | 6 |
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) |