mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
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.
This commit is contained in:
parent
4cbd05c322
commit
43d9a58dfd
2 changed files with 9 additions and 19 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue