[Python-checkins] r58036 - python/trunk/Lib/ctypes/__init__.py

thomas.heller python-checkins at python.org
Fri Sep 7 11:33:24 CEST 2007


Author: thomas.heller
Date: Fri Sep  7 11:33:24 2007
New Revision: 58036

Modified:
   python/trunk/Lib/ctypes/__init__.py
Log:
Backport from py3k branch:

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.


Modified: python/trunk/Lib/ctypes/__init__.py
==============================================================================
--- python/trunk/Lib/ctypes/__init__.py	(original)
+++ python/trunk/Lib/ctypes/__init__.py	Fri Sep  7 11:33:24 2007
@@ -545,3 +545,9 @@
     elif sizeof(kind) == 4: c_uint32 = kind
     elif sizeof(kind) == 8: c_uint64 = kind
 del(kind)
+
+# XXX for whatever reasons, creating the first instance of a callback
+# function is needed for the unittests on Win64 to succeed.  This MAY
+# be a compiler bug, since the problem occurs only when _ctypes is
+# compiled with the MS SDK compiler.  Or an uninitialized variable?
+CFUNCTYPE(c_int)(lambda: None)


More information about the Python-checkins mailing list