From d3cb04d6af67f0cff4a00375b7ce4e8485cbeb4a Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 18 May 2001 20:07:18 +0000 Subject: __read(), _seed(): Since IOError and OSError are both derived from EnvironmentError, it makes for slightly cleaner and more efficient code to catch the common base class rather than a tuple containing the two derived classes. --- Mailman/LockFile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mailman/LockFile.py b/Mailman/LockFile.py index 58256b70d..a4b9dbb66 100644 --- a/Mailman/LockFile.py +++ b/Mailman/LockFile.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc. +# Copyright (C) 1998,1999,2000,2001 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -359,7 +359,7 @@ class LockFile: filename = fp.read() fp.close() return filename - except (OSError, IOError), e: + except EnvironmentError, e: if e.errno <> errno.ENOENT: raise return None @@ -471,7 +471,7 @@ def _seed(): fp = open('/dev/random') d = fp.read(40) fp.close() - except (IOError, OSError), e: + except EnvironmentError, e: if e.errno <> errno.ENOENT: raise import sha -- cgit v1.3.1