From 06133ef0c32634d8360d8139a38f6621c68e9853 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Wed, 21 Sep 2011 20:54:47 -0400 Subject: [PATCH] mylife: catch IOError too --- modules/mylife.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/mylife.py b/modules/mylife.py index c5ae020..871d6e6 100644 --- a/modules/mylife.py +++ b/modules/mylife.py @@ -16,7 +16,7 @@ def fml(phenny, input): """.fml""" try: req = web.get("http://www.fmylife.com/random") - except HTTPError: + except HTTPError, IOError: phenny.say("I tried to use .fml, but it was broken. FML") return @@ -29,7 +29,7 @@ def mlia(phenny, input): """.mlia - My life is average.""" try: req = web.get("http://mylifeisaverage.com/") - except HTTPError: + except HTTPError, IOError: phenny.say("I tried to use .mlia, but it wasn't loading. MLIA") return @@ -43,7 +43,7 @@ def mliarab(phenny, input): """.mliarab - My life is Arabic.""" try: req = web.get("http://mylifeisarabic.com/random/") - except HTTPError: + except HTTPError, IOError: phenny.say("The site you requested, mylifeisarabic.com, has been banned \ in the UAE. You will be reported to appropriate authorities") return @@ -59,7 +59,7 @@ def mlib(phenny, input): """.mlib - My life is bro.""" try: req = web.get("http://mylifeisbro.com/random") - except HTTPError: + except HTTPError, IOError: phenny.say("MLIB is out getting a case of Natty. It's chill.") return @@ -72,7 +72,7 @@ def mlic(phenny, input): """.mlic - My life is creepy.""" try: req = web.get("http://mylifeiscreepy.com/random") - except HTTPError: + except HTTPError, IOError: phenny.say("Error: Have you checked behind you?") return @@ -86,7 +86,7 @@ def mlid(phenny, input): """.mlib - My life is Desi.""" try: req = web.get("http://www.mylifeisdesi.com/random") - except HTTPError: + except HTTPError, IOError: phenny.say("MLID is busy at the hookah lounge, be back soon.") return @@ -99,7 +99,7 @@ def mlig(phenny, input): """.mlig - My life is ginger.""" try: req = web.get("http://www.mylifeisginger.org/random") - except HTTPError: + except HTTPError, IOError: phenny.say("Busy eating your soul. Be back soon.") return @@ -112,7 +112,7 @@ def mlih(phenny, input): """.mlih - My life is ho.""" try: req = web.get("http://mylifeisho.com/random") - except HTTPError: + except HTTPError, IOError: phenny.say("MLIH is giving some dome to some lax bros.") return @@ -125,7 +125,7 @@ def mlihp(phenny, input): """.mlihp - My life is Harry Potter.""" try: req = web.get("http://www.mylifeishp.com/random") - except HTTPError: + except HTTPError, IOError: phenny.say("This service is not available to Muggles.") return @@ -138,7 +138,7 @@ def mlit(phenny, input): """.mlit - My life is Twilight.""" try: req = web.get("http://mylifeistwilight.com/random") - except HTTPError: + except HTTPError, IOError: phenny.say("Error: Your life is too Twilight. Go outside.") return