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

Skip to content

Commit 674e938

Browse files
author
Thomas Heller
committed
Add a workaround for a strange bug on win64, when _ctypes is compiled
with the SDK compiler. This should fix the failing Lib\ctypes\test\test_as_parameter.py test.
1 parent c5a6a30 commit 674e938

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/ctypes/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,3 +535,9 @@ def DllCanUnloadNow():
535535
elif sizeof(kind) == 4: c_uint32 = kind
536536
elif sizeof(kind) == 8: c_uint64 = kind
537537
del(kind)
538+
539+
# XXX for whatever reasons, creating the first instance of a callback
540+
# function is needed for the unittests on Win64 to succeed. This MAY
541+
# be a compiler bug, since the problem occurs only when _ctypes is
542+
# compiled with the MS SDK compiler. Or an uninitialized variable?
543+
CFUNCTYPE(c_int)(lambda: None)

0 commit comments

Comments
 (0)