ó oŽ¸Qc@sŒddlTddlZddlZd„ZejdkrVdejfd„ƒYZndejfd„ƒYZed krˆej ƒndS( i˙˙˙˙(t*NcCsd|t|ƒ‚dS(Ni*(t ValueError(targ((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyt callback_funcstwin32tcall_function_TestCasecBseZd„ZRS(cCs“ddlm}ttjj_ttftjj_ ttjj_tjjdƒ}tjj|dƒ}|j ||dƒtjj dƒƒdS(Ni˙˙˙˙(t call_functiontkernel32tGetModuleHandleA(N( t_ctypesRtc_void_ptwindllRt LoadLibraryAtrestypetc_char_ptGetProcAddresstargtypest assertEqualtNoneR(tselfRthdlltfuncaddr((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyttests(t__name__t __module__R(((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyR stCallbackTracbackTestCasecBs5eZd„Zd„Zd„Zd„Zd„ZRS(cOsPddl}tj}|jƒ}t_z|||ŽWd|t_X|jƒS(Ni˙˙˙˙(tStringIOtsyststderrtgetvalue(RtfunctargstkwRt old_stderrtlogger((s4/sys/lib/python2.7/ctypes/test/test_random_things.pytcapture_stderr&s   cCsEtttƒtƒ}|j|dƒ}|j|jƒddƒdS(Ni*i˙˙˙˙sValueError: 42(t CFUNCTYPEtc_intRR#Rt splitlines(Rtcbtout((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyttest_ValueError1scCsItttƒtƒ}|j|dƒ}|j|jƒdd dƒdS(Nii˙˙˙˙isZeroDivisionError: (R$R%RR#RR&(RR'R(((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyttest_IntegerDivisionError7scCsItttƒtƒ}|j|dƒ}|j|jƒdd dƒdS(Ngi˙˙˙˙isZeroDivisionError: (R$R%tc_doubleRR#RR&(RR'R(((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyttest_FloatDivisionError=scCsEtttƒtƒ}|j|dƒ}|j|jƒddƒdS(Ntspami˙˙˙˙s>TypeError: unsupported operand type(s) for //: 'int' and 'str'(R$R%RRR#RR&(RR'R(((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyttest_TypeErrorDivisionErrorCs(RRR#R)R*R,R.(((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyRs    t__main__( tctypestunittestRRtplatformtTestCaseRRRtmain(((s4/sys/lib/python2.7/ctypes/test/test_random_things.pyts  0