diff options
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/ctypes/test/test_win32.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py index 8247d37..eb016ff 100644 --- a/Lib/ctypes/test/test_win32.py +++ b/Lib/ctypes/test/test_win32.py @@ -30,15 +30,11 @@ if sys.platform == "win32": # or wrong calling convention self.assertRaises(ValueError, IsWindow, None) - 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"): + 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. self.assertRaises(WindowsError, windll.kernel32.GetModuleHandleA, 32) class Structures(unittest.TestCase): |
