[Python-checkins] r47206 - in python/trunk: Lib/ctypes/test/test_win32.py Modules/_ctypes/callproc.c
Thomas Heller
theller at python.net
Thu Jul 6 09:26:41 CEST 2006
Neal Norwitz schrieb:
> On 7/3/06, thomas.heller <python-checkins at python.org> wrote:
>> Author: thomas.heller
>> Date: Mon Jul 3 10:08:14 2006
>> New Revision: 47206
>>
>> Modified:
>> python/trunk/Lib/ctypes/test/test_win32.py
>> python/trunk/Modules/_ctypes/callproc.c
>> Log:
>> Add a new function uses_seh() to the _ctypes extension module. This
>> will return True if Windows Structured Exception handling (SEH) is
>> used when calling functions, False otherwise.
>>
>> Currently, only MSVC supports SEH.
>>
>> Fix the test so that it doesn't crash when run with MingW compiled
>> _ctypes. Note that two tests are still failing when mingw is used, I
>> suspect structure layout differences and function calling conventions
>> between MSVC and MingW.
>
> This seems like a really minor/limited feature. Can't this wait for
> 2.6? I would prefer this change was reverted.
This feature only provides a way to have access from Python to the value of
the #define DONT_USE_SEH symbol used when compiling, which gets set depending
on whether mingw or msvc is used. I can revert the patch, but then I would
like to change Lib/test/test_win32.py so that the test_SEH testcase is skipped
by default:
Index: test_win32.py
===================================================================
--- test_win32.py (Revision 47206)
+++ test_win32.py (Arbeitskopie)
@@ -30,8 +30,7 @@
# or wrong calling convention
self.assertRaises(ValueError, IsWindow, None)
- import _ctypes
- if _ctypes.uses_seh():
+ if is_resource_enabled("SEH"):
def test_SEH(self):
# Call functions with invalid arguments, and make sure that access violations
# are trapped and raise an exception.
Thomas
More information about the Python-checkins
mailing list