ยปCore Development>Code coverage>Lib/ctypes/test/test_errcheck.py

Python code coverage for Lib/ctypes/test/test_errcheck.py

#countcontent
1n/aimport sys
2n/afrom ctypes import *
3n/a
4n/a##class HMODULE(Structure):
5n/a## _fields_ = [("value", c_void_p)]
6n/a
7n/a## def __repr__(self):
8n/a## return "<HMODULE %s>" % self.value
9n/a
10n/a##windll.kernel32.GetModuleHandleA.restype = HMODULE
11n/a
12n/a##print windll.kernel32.GetModuleHandleA("python23.dll")
13n/a##print hex(sys.dllhandle)
14n/a
15n/a##def nonzero(handle):
16n/a## return (GetLastError(), handle)
17n/a
18n/a##windll.kernel32.GetModuleHandleA.errcheck = nonzero
19n/a##print windll.kernel32.GetModuleHandleA("spam")