From: James Bunton Date: Sun, 29 Jul 2007 07:48:09 +0000 (+1000) Subject: Catch a few more possible exceptions X-Git-Url: https://code.delx.au/pymsnt/commitdiff_plain/638151079dd540ee67552953af0db82e9f91b5c0 Catch a few more possible exceptions --- diff --git a/src/avatar.py b/src/avatar.py index 1ba454c..b9f7dfc 100644 --- a/src/avatar.py +++ b/src/avatar.py @@ -89,7 +89,7 @@ class AvatarCache: f = open(self.dir(key) + key, 'wb') f.write(imageData) f.close() - except IOError, e: + except (OSError, IOError), e: LogEvent(WARN, "", "IOError writing to avatar %s - %s" % (key, str(e))) os.umask(prev_umask) return avatar @@ -114,7 +114,7 @@ class AvatarCache: return data else: LogEvent(INFO, "", "Avatar not found.") - except IOError: + except (OSError, IOError): LogEvent(WARN, "", "IOError reading avatar.") else: return None