summaryrefslogtreecommitdiff
path: root/Mailman/MailList.py
diff options
context:
space:
mode:
authorbwarsaw2002-04-05 14:43:28 +0000
committerbwarsaw2002-04-05 14:43:28 +0000
commit09e916bb84af4badc53741963cbbdd97cd53298a (patch)
tree28ee394435adac0bfb7e9209e839949aa1d7b235 /Mailman/MailList.py
parentf562dac1f5db5720ce06dcf3f228972ba4e67696 (diff)
downloadmailman-09e916bb84af4badc53741963cbbdd97cd53298a.tar.gz
mailman-09e916bb84af4badc53741963cbbdd97cd53298a.tar.zst
mailman-09e916bb84af4badc53741963cbbdd97cd53298a.zip
Diffstat (limited to 'Mailman/MailList.py')
-rw-r--r--Mailman/MailList.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 28e60ac39..338eb522e 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -493,14 +493,21 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin,
loadfunc = cPickle.load
else:
assert 0, 'Bad database file name'
- mtime = os.path.getmtime(dbfile)
- if mtime <= self.__timestamp:
- # File is not newer
- return None, None
try:
+ # Check the mod time of the file first. If it matches our
+ # timestamp, then the state hasn't change since the last time we
+ # loaded it. Otherwise open the file for loading, below. If the
+ # file doesn't exist, we'll get an EnvironmentError with errno set
+ # to ENOENT (EnvironmentError is the base class of IOError and
+ # OSError).
+ mtime = os.path.getmtime(dbfile)
+ if mtime <= self.__timestamp:
+ # File is not newer
+ return None, None
fp = open(dbfile)
- except IOError, e:
+ except EnvironmentError, e:
if e.errno <> errno.ENOENT: raise
+ # The file doesn't exist yet
return None, e
try:
try: