def _delete_folder(folder_path, warn=False):
 try:
  if os.path.exists(folder_path):
   shutil.rmtree(folder_path)
 except WindowsError:
  if warn:
   warnings.warn(('Could not delete temporary folder %s' % folder_path))

def _delete_folder ( folder_path , warn = False ) : try : if os . path . exists ( folder_path ) : shutil . rmtree ( folder_path ) except WindowsError : if warn : warnings . warn ( ( 'Could not delete temporary folder %s' % folder_path ) )
utility function to cleanup a temporary folder if still existing .