]> code.delx.au - pymsnt/commitdiff
Catch a few more possible exceptions
authorJames Bunton <jamesbunton@fastmail.fm>
Sun, 29 Jul 2007 07:48:09 +0000 (17:48 +1000)
committerJames Bunton <jamesbunton@fastmail.fm>
Sun, 29 Jul 2007 07:48:09 +0000 (17:48 +1000)
src/avatar.py

index 1ba454cacdf2e89e6424a3a001c446f6c4c94800..b9f7dfc900eeb313a9a698edf7934748486b8fbd 100644 (file)
@@ -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