def _unlock_cache(w_lock):
 if (not os.path.exists(w_lock)):
  return
 try:
  if os.path.isdir(w_lock):
   os.rmdir(w_lock)
  elif os.path.isfile(w_lock):
   os.unlink(w_lock)
 except (OSError, IOError) as exc:
  log.trace('Error removing lockfile {0}: {1}'.format(w_lock, exc))

def _unlock_cache ( w_lock ) : if ( not os . path . exists ( w_lock ) ) : return try : if os . path . isdir ( w_lock ) : os . rmdir ( w_lock ) elif os . path . isfile ( w_lock ) : os . unlink ( w_lock ) except ( OSError , IOError ) as exc : log . trace ( 'Error removing lockfile {0}: {1}' . format ( w_lock , exc ) )
unlock a fs file/dir based lock .