summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-07-06 07:50:18 (GMT)
committerThomas Heller <theller@ctypes.org>2006-07-06 07:50:18 (GMT)
commit43d9a58dfda44f453ef330fb9c05fbabb7b82591 (patch)
tree21ed74d1bd409d3f57bf72b96263507f6b6056a9 /Lib/ctypes
parent4cbd05c322d7ebb95b3623fe8e24b5e6bab7492c (diff)
downloadcpython-43d9a58dfda44f453ef330fb9c05fbabb7b82591.zip
cpython-43d9a58dfda44f453ef330fb9c05fbabb7b82591.tar.gz
cpython-43d9a58dfda44f453ef330fb9c05fbabb7b82591.tar.bz2
Revert the change done in svn revision 47206:
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.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/test/test_win32.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py
index eb016ff..8247d37 100644
--- a/Lib/ctypes/test/test_win32.py
+++ b/Lib/ctypes/test/test_win32.py
@@ -30,11 +30,15 @@ if sys.platform == "win32":
# or wrong calling convention
self.assertRaises(ValueError, IsWindow, None)
- import _ctypes
- if _ctypes.uses_seh():
- def test_SEH(self):
- # Call functions with invalid arguments, and make sure that access violations
- # are trapped and raise an exception.
+ def test_SEH(self):
+ # Call functions with invalid arguments, and make sure that access violations
+ # are trapped and raise an exception.
+ #
+ # Normally, in a debug build of the _ctypes extension
+ # module, exceptions are not trapped, so we can only run
+ # this test in a release build.
+ import sys
+ if not hasattr(sys, "getobjects"):
self.assertRaises(WindowsError, windll.kernel32.GetModuleHandleA, 32)
class Structures(unittest.TestCase):