From bac45db04f25fc3704d752e037579b8a3f19bd9d Mon Sep 17 00:00:00 2001 From: James French Date: Mon, 2 Aug 2010 13:12:33 +0800 Subject: [PATCH] Catching some more exceptions --- icalparse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/icalparse.py b/icalparse.py index 780750b..2c7ec4e 100755 --- a/icalparse.py +++ b/icalparse.py @@ -97,7 +97,7 @@ def getContent(url='',stdin=False): res = urllib2.urlopen(url) content = res.read() res.close() - except (urllib2.URLError, ValueError), e: + except (urllib2.URLError, OSError), e: sys.stderr.write('%s\n'%e) sys.exit(1) return content @@ -131,7 +131,7 @@ def getHTTPContent(url='',cache='.httplib2-cache'): try: content = urllib2.urlopen(url).read() return content - except urllib2.URLError, e: + except (urllib2.URLError, OSError), e: sys.stderr.write('%s\n'%e) sys.exit(1) -- 2.20.1