Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 29360893df0931703cb2fe0c0fbc0fc963e64ead authored by Georg Brandl on 20 February 2011, 10:31:59 UTC
Make a 3.2 maintenance branch.
Tip revision: 2936089
test_errcheck.py
import sys
from ctypes import *

##class HMODULE(Structure):
##    _fields_ = [("value", c_void_p)]

##    def __repr__(self):
##        return "<HMODULE %s>" % self.value

##windll.kernel32.GetModuleHandleA.restype = HMODULE

##print windll.kernel32.GetModuleHandleA("python23.dll")
##print hex(sys.dllhandle)

##def nonzero(handle):
##    return (GetLastError(), handle)

##windll.kernel32.GetModuleHandleA.errcheck = nonzero
##print windll.kernel32.GetModuleHandleA("spam")
back to top