Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 11a859d70dffc8da51d346dabd1fe6a635825ae5 authored by Martin v. Löwis on 28 May 2011, 11:58:36 UTC
r88840: Prepare for 2.5.6.
Tip revision: 11a859d
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