code: def _run_exitfuncs():
      
  
      while _exithandlers:
          func, targs, kargs =  _exithandlers.pop()
          func(*targs, **kargs)
docs: run any registered exit functions
  
      _exithandlers is traversed in reverse order so functions are executed
      last in, first out.