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

        self.original['register'](func, *targs, **kwargs)
Intercept :func:`atexit.register` calls, diverting any to
        :func:`shutil.rmtree` into a private list.