aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xarchivemail.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/archivemail.py b/archivemail.py
index 4adf6b1..f570456 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -160,8 +160,13 @@ class StaleFiles:
vprint("removing stale tempfile directory '%s'" % self.temp_dir)
try:
os.rmdir(self.temp_dir)
- self.temp_dir = None
- except (IOError, OSError): pass
+ except OSError, e:
+ if e.errno == errno.ENOTEMPTY: # Probably a bug
+ user_warning("cannot remove temporary directory '%s', "
+ "directory not empty" % self.temp_dir)
+ except IOError: pass
+ else: self.temp_dir = None
+
class Options: