code: def _atexit__register(self, func, *targs, **kwargs):
          
          if func == shutil.rmtree:
              self.deferred.append((func, targs, kwargs))
              return
  
          self.original['register'](func, *targs, **kwargs)
docs: Intercept :func:`atexit.register` calls, diverting any to
          :func:`shutil.rmtree` into a private list.