switch to requests for HTTP queries

This commit is contained in:
mutantmonkey
2013-06-08 22:27:24 -07:00
parent 259c222623
commit 5cb88f3cf8
23 changed files with 131 additions and 161 deletions

View File

@@ -7,7 +7,6 @@ author: mutantmonkey <mutantmonkey@mutantmonkey.in>
from tools import GrumbleError
from modules import weather
import urllib.error
import random
import metar
import web
@@ -31,7 +30,7 @@ def tfw(phenny, input, fahrenheit=False, celsius=False):
bytes = web.get(uri % icao_code)
except AttributeError:
raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.")
except urllib.error.HTTPError:
except web.HTTPError:
phenny.say("WHERE THE FUCK IS THAT? Try another location.")
return