def cleanup_tempdir(the_dir):
 if os.path.exists(the_dir):
  shutil.rmtree(the_dir)

def cleanup_tempdir ( the_dir ) : if os . path . exists ( the_dir ) : shutil . rmtree ( the_dir )
called on process exit to remove a temp directory .