From 9f2bffa7a53f5733c7f8826d9b4b51d7aa75eb8c Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Mon, 10 Dec 2012 01:59:33 +1300 Subject: [PATCH] Python makes this stuff too easy xD --- plugins/gcalc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/gcalc.py b/plugins/gcalc.py index b419f5f..369cd65 100755 --- a/plugins/gcalc.py +++ b/plugins/gcalc.py @@ -8,8 +8,8 @@ def calc(inp): soup = http.get_soup('http://www.google.com/search', q=inp) - response = soup.find('h2', {'class': 'r'}) - if response is None: + result = soup.find('h2', {'class': 'r'}) + if not result: return "Could not calculate '%s'" % inp - return http.unescape(response.contents[0]) + return result.contents[0]