def mkdtemp_clean(suffix='', prefix='tmp', dir=None):
 the_dir = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir)
 atexit.register(cleanup_tempdir, the_dir)
 return the_dir

def mkdtemp_clean ( suffix = '' , prefix = 'tmp' , dir = None ) : the_dir = tempfile . mkdtemp ( suffix = suffix , prefix = prefix , dir = dir ) atexit . register ( cleanup_tempdir , the_dir ) return the_dir
just like mkdtemp .