Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: f5f9d99974febbff6d4d55ef36bbfa0c71ed0738 authored by Barry Warsaw on 12 September 2008, 23:35:48 UTC
Fix the release level
Tip revision: f5f9d99
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