code: def _unlock_cache(w_lock):
      '''
      Unlock a FS file/dir based 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 %s: %s', w_lock, excf _unlock_cache(w_lock):
      '''
      Unlock a FS file/dir based 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 %s: %s', w_lock, exc)
docs: Unlock a FS file/dir based lock