瀏覽代碼

Catch empty Google results properly.

tags/v0.3
Ben Kurtovic 8 年之前
父節點
當前提交
fbb9ea7b03
共有 1 個檔案被更改,包括 5 行新增1 行删除
  1. +5
    -1
      earwigbot/wiki/copyvios/search.py

+ 5
- 1
earwigbot/wiki/copyvios/search.py 查看文件

@@ -161,7 +161,11 @@ class GoogleSearchEngine(_BaseSearchEngine):
except ValueError:
err = "Google Error: JSON could not be decoded"
raise SearchQueryError(err)
return [item["link"] for item in res["items"]]

try:
return [item["link"] for item in res["items"]]
except KeyError:
return []


class YahooBOSSSearchEngine(_BaseSearchEngine):


Loading…
取消
儲存