def register_rmtree(directory, cleaner=_mkdtemp_atexit_cleaner):
 with _MKDTEMP_LOCK:
  _mkdtemp_register_cleaner(cleaner)
  _MKDTEMP_DIRS[os.getpid()].add(directory)
 return directory

def register_rmtree ( directory , cleaner = _mkdtemp_atexit_cleaner ) : with _MKDTEMP_LOCK : _mkdtemp_register_cleaner ( cleaner ) _MKDTEMP_DIRS [ os . getpid ( ) ] . add ( directory ) return directory
register an existing directory to be cleaned up at process exit .