Catching some more exceptions
authorJames French <[email protected]>
Mon, 2 Aug 2010 05:12:33 +0000 (13:12 +0800)
committerJames French <[email protected]>
Mon, 2 Aug 2010 05:12:33 +0000 (13:12 +0800)
icalparse.py

index 780750b..2c7ec4e 100755 (executable)
@@ -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)
 

UCC git Repository :: git.ucc.asn.au