]> granicus.if.org Git - python/commitdiff
Issue #8966: Fix ctypes tests for Windows
authorVictor Stinner <victor.stinner@haypocalc.com>
Sat, 31 Jul 2010 10:52:56 +0000 (10:52 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sat, 31 Jul 2010 10:52:56 +0000 (10:52 +0000)
I removed the implicit conversion from str to bytes.

Lib/ctypes/test/test_bytes.py
Lib/ctypes/test/test_loading.py
Lib/ctypes/test/test_random_things.py

index 57cf365ea2f8cbc2469cf37d05379b1fc318f27d..ee49c456e8ed2451d3c6c6beb6c403e61cb0c92b 100644 (file)
@@ -45,7 +45,6 @@ class BytesTest(unittest.TestCase):
                 _type_ = "X"
 
             BSTR("abc")
-            BSTR(b"abc")
 
 if __name__ == '__main__':
     unittest.main()
index 07b69ec2011acc0dd67b6de1c53be5db5ddc0e6f..4029b463bcd7bcf56465529d1b3faf3260040fab 100644 (file)
@@ -97,7 +97,7 @@ class LoaderTest(unittest.TestCase):
             self.assertEqual(0, advapi32.CloseEventLog(None))
             windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
             windll.kernel32.GetProcAddress.restype = c_void_p
-            proc = windll.kernel32.GetProcAddress(advapi32._handle, "CloseEventLog")
+            proc = windll.kernel32.GetProcAddress(advapi32._handle, b"CloseEventLog")
             self.assertTrue(proc)
             # This is the real test: call the function via 'call_function'
             self.assertEqual(0, call_function(proc, (None,)))
index 4e9f08fb70b6792db03e5650a37b5b3f66eb64cf..515acf509a669081ba8d930b647700bb103416a4 100644 (file)
@@ -18,7 +18,7 @@ if sys.platform == "win32":
             windll.kernel32.GetProcAddress.restype = c_void_p
 
             hdll = windll.kernel32.LoadLibraryA(b"kernel32")
-            funcaddr = windll.kernel32.GetProcAddress(hdll, "GetModuleHandleA")
+            funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA")
 
             self.assertEqual(call_function(funcaddr, (None,)),
                                  windll.kernel32.GetModuleHandleA(None))