Fix minor race when deleting messages in a maildir/mh box

Nothing serious, but if another client deleted it in the small window after
we checked it, we would have crashed trying to delete a non-existing file.
This commit is contained in:
Nikolaus Schulz 2008-08-09 03:27:25 +02:00
parent a7414319c9
commit 54821151e4
1 changed files with 4 additions and 3 deletions

View File

@ -1220,9 +1220,10 @@ def _archive_dir(mailbox_name, final_archive_name, type):
if archive:
archive.finalise()
for file_name in delete_queue:
if os.path.isfile(file_name):
vprint("removing original message: '%s'" % file_name)
os.remove(file_name)
vprint("removing original message: '%s'" % file_name)
try: os.remove(file_name)
except OSError, e:
if e.errno != errno.ENOENT: raise
if not options.quiet:
stats.display()