def _run_exitfuncs():
 exc_info = None
 while _exithandlers:
  (func, targs, kargs) = _exithandlers.pop()
  try:
   func(*targs, **kargs)
  except SystemExit:
   exc_info = sys.exc_info()
  except:
   import traceback
   sys.stderr.write('Error in atexit._run_exitfuncs:\n')
   traceback.print_exc()
   exc_info = sys.exc_info()
 if (exc_info is not None):
  raise exc_info[0](exc_info[1])

def _run_exitfuncs ( ) : exc_info = None while _exithandlers : ( func , targs , kargs ) = _exithandlers . pop ( ) try : func ( * targs , ** kargs ) except SystemExit : exc_info = sys . exc_info ( ) except : import traceback sys . stderr . write ( 'Error in atexit._run_exitfuncs:\n' ) traceback . print_exc ( ) exc_info = sys . exc_info ( ) if ( exc_info is not None ) : raise exc_info [ 0 ] ( exc_info [ 1 ] )
run any registered exit functions _exithandlers is traversed in reverse order so functions are executed last in .