mς %U²Ic@sΑdZdgZdkZgZd„Zd„Zeedƒoeeiƒnee_edjoVd„Z d„Z dd „Z ee ƒee d ƒee d d ƒee d ƒndS(sœ atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. tregisterNcCsΌd}x†to~tiƒ\}}}y|||ŽWq tj otiƒ}q dk }ti dIJ|i ƒtiƒ}q Xq W|dj o|d|d|d‚ndS(s‰run any registered exit functions _exithandlers is traversed in reverse order so functions are executed last in, first out. NsError in atexit._run_exitfuncs:iii( tNonetexc_infot _exithandlerstpoptfuncttargstkargst SystemExittsyst tracebacktstderrt print_exc(RR RRR((t#/data/zmath/lib/python2.4/atexit.pyt_run_exitfuncs s     cOsti|||fƒdS(sΧregister a function to be executed upon normal program termination func - function to be called at exit targs - optional arguments to pass to func kargs - optional keyword arguments to pass to func N(RtappendRRR(RRR((R R%stexitfunct__main__cCs dGHdS(Ns running x1((((R tx14scCsd|fGHdS(Nsrunning x2(%r)(tn(R((R tx26scCsd||fGHdS(Nsrunning x3(%r, kwd=%r)(Rtkwd(RR((R tx38si itbars no kwd args( t__doc__t__all__R RRRthasattrRt__name__RRRR(RRRRR RRR((R t?s