diff options
| author | Thomas Heller <theller@ctypes.org> | 2007-07-12 19:58:41 +0000 |
|---|---|---|
| committer | Thomas Heller <theller@ctypes.org> | 2007-07-12 19:58:41 +0000 |
| commit | 8750384dbc9ceeaab754e9738f0c5150e7c847eb (patch) | |
| tree | a78007af73358765eea8edda10426529b95b3a96 | |
| parent | d660fabd24dfd48df43bc0717cfec44385ae736e (diff) | |
| download | cpython-git-8750384dbc9ceeaab754e9738f0c5150e7c847eb.tar.gz | |
More easy fixes. The ctypes unittests pass now (on Windows).
| -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 0d0b56fd74..0cca8619a3 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 f267413dd6..8348c8b66f 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) |
