def __enter__(self):
    self.name = tempfile.mkdtemp()
return self.name

def __exit__(self, exc_type, exc_value, traceback):
    shutil.rmtree(self.name)
how to delete dir created by python tempfile.mkdtemp