From: Thomas Heller Date: Thu, 12 Jul 2007 19:58:41 +0000 (+0000) Subject: More easy fixes. The ctypes unittests pass now (on Windows). X-Git-Tag: v3.0a1~652 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8750384dbc9ceeaab754e9738f0c5150e7c847eb;p=thirdparty%2FPython%2Fcpython.git More easy fixes. The ctypes unittests pass now (on Windows). --- diff --git a/Lib/ctypes/test/test_functions.py b/Lib/ctypes/test/test_functions.py index 0d0b56fd74cb..0cca8619a3ad 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 f267413dd6f5..8348c8b66fd9 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)