def safe_mkdtemp(cleaner=_mkdtemp_atexit_cleaner, **kw):
 with _MKDTEMP_LOCK:
  return register_rmtree(tempfile.mkdtemp(**kw), cleaner=cleaner)

def safe_mkdtemp ( cleaner = _mkdtemp_atexit_cleaner , ** kw ) : with _MKDTEMP_LOCK : return register_rmtree ( tempfile . mkdtemp ( ** kw ) , cleaner = cleaner )
create a temporary directory that is cleaned up on process exit .