diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-11-24 21:14:22 +0000 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-11-24 21:14:22 +0000 |
commit | d26fc8d81f88f92eb798e28c49b9990dbc73bc14 (patch) | |
tree | 3c897ccae42ac17e67b7809aa06259181acc54c6 /modules/search.py | |
parent | 4eb5bb894267bb37adf5b92e6c28dce2908e73bd (diff) | |
download | bot-d26fc8d81f88f92eb798e28c49b9990dbc73bc14.tar.gz bot-d26fc8d81f88f92eb798e28c49b9990dbc73bc14.tar.bz2 bot-d26fc8d81f88f92eb798e28c49b9990dbc73bc14.zip |
Applied a patch to weather.py from Chris Waigl, and fixed search.py.
Diffstat (limited to 'modules/search.py')
-rwxr-xr-x | modules/search.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/search.py b/modules/search.py index 8523832..37c7b86 100755 --- a/modules/search.py +++ b/modules/search.py @@ -31,9 +31,8 @@ def search(query): def result(query): results = search(query) - if results['responseData']: - return results['responseData']['results'][0]['unescapedUrl'] - return None + try: return results['responseData']['results'][0]['unescapedUrl'] + except IndexError: return None def count(query): results = search(query) |