[Python-3000-checkins] r56336 - python/branches/py3k-struni/Lib/ctypes/test/test_functions.py python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py

thomas.heller python-3000-checkins at python.org
Thu Jul 12 21:58:42 CEST 2007


Author: thomas.heller
Date: Thu Jul 12 21:58:41 2007
New Revision: 56336

Modified:
   python/branches/py3k-struni/Lib/ctypes/test/test_functions.py
   python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py
Log:
More easy fixes.  The ctypes unittests pass now (on Windows).


Modified: python/branches/py3k-struni/Lib/ctypes/test/test_functions.py
==============================================================================
--- python/branches/py3k-struni/Lib/ctypes/test/test_functions.py	(original)
+++ python/branches/py3k-struni/Lib/ctypes/test/test_functions.py	Thu Jul 12 21:58:41 2007
@@ -166,7 +166,7 @@
             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)

Modified: python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py
==============================================================================
--- python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py	(original)
+++ python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py	Thu Jul 12 21:58:41 2007
@@ -74,11 +74,11 @@
             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)


More information about the Python-3000-checkins mailing list