Commits

Victor Stinner  committed e486d19

Issue #8966: Fix ctypes tests for Windows

I removed the implicit conversion from str to bytes.

  • Participants
  • Parent commits 29e60ce

Comments (0)

Files changed (3)

File Lib/ctypes/test/test_bytes.py

                 _type_ = "X"
 
             BSTR("abc")
-            BSTR(b"abc")
 
 if __name__ == '__main__':
     unittest.main()

File Lib/ctypes/test/test_loading.py

             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,)))

File Lib/ctypes/test/test_random_things.py

             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))