Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: e054f452bd9118def58c18aa295662c9845e1c89 authored by Georg Brandl on 29 September 2012, 07:44:17 UTC
Fix test_sys.test_implementation for final releases.
Tip revision: e054f45
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