From b04af2979fc4593be77eaeb416dd63f1069d7752 Mon Sep 17 00:00:00 2001 From: Elad Alfassa Date: Fri, 2 May 2014 22:43:45 +0300 Subject: [PATCH] [search] Fix google search in Python 3 I wonder when it broke --- search.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/search.py b/search.py index 9c4fb993b4..96ba8d32ec 100644 --- a/search.py +++ b/search.py @@ -13,6 +13,7 @@ from willie import web from willie.module import commands, example import json +import sys import time @@ -21,6 +22,8 @@ def google_ajax(query): uri = 'http://ajax.googleapis.com/ajax/services/search/web' args = '?v=1.0&safe=off&q=' + query bytes = web.get(uri + args) + if sys.version_info.major >= 3: + bytes = bytes.decode() return json.loads(bytes)