Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5baeee

Browse files
author
Victor Stinner
committed
Issue #8966: Fix ctypes tests for Windows
I removed the implicit conversion from str to bytes.
1 parent 73a01d4 commit d5baeee

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

Lib/ctypes/test/test_bytes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class BSTR(_SimpleCData):
4545
_type_ = "X"
4646

4747
BSTR("abc")
48-
BSTR(b"abc")
4948

5049
if __name__ == '__main__':
5150
unittest.main()

Lib/ctypes/test/test_loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_1703286_B(self):
9797
self.assertEqual(0, advapi32.CloseEventLog(None))
9898
windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
9999
windll.kernel32.GetProcAddress.restype = c_void_p
100-
proc = windll.kernel32.GetProcAddress(advapi32._handle, "CloseEventLog")
100+
proc = windll.kernel32.GetProcAddress(advapi32._handle, b"CloseEventLog")
101101
self.assertTrue(proc)
102102
# This is the real test: call the function via 'call_function'
103103
self.assertEqual(0, call_function(proc, (None,)))

Lib/ctypes/test/test_random_things.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test(self):
1818
windll.kernel32.GetProcAddress.restype = c_void_p
1919

2020
hdll = windll.kernel32.LoadLibraryA(b"kernel32")
21-
funcaddr = windll.kernel32.GetProcAddress(hdll, "GetModuleHandleA")
21+
funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA")
2222

2323
self.assertEqual(call_function(funcaddr, (None,)),
2424
windll.kernel32.GetModuleHandleA(None))

0 commit comments

Comments
 (0)