summaryrefslogtreecommitdiff
path: root/larch
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-04-23 09:28:17 +0100
committerLars Wirzenius <liw@liw.fi>2012-04-23 09:28:17 +0100
commitea79516de482f4867f243afd3c30f552b2f7fae7 (patch)
tree4f3594108965e8465662e6ab6581ef53723caf8c /larch
parent69591ee375dcff4d48c5f9a9a4e00eb7c9a31cff (diff)
downloadlarch-ea79516de482f4867f243afd3c30f552b2f7fae7.tar.gz
Ignore missing files, directories, when removing stuff
Diffstat (limited to 'larch')
-rw-r--r--larch/journal.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/larch/journal.py b/larch/journal.py
index efc7344..4ea1e9f 100644
--- a/larch/journal.py
+++ b/larch/journal.py
@@ -243,8 +243,11 @@ class Journal(object):
for pathname in self.climb(deletedir, files_only=True):
if pathname != deletedir:
realname = self._realname(deletedir, pathname)
- if not self.fs.isdir(realname):
+ try:
self.fs.remove(realname)
+ except OSError, e: # pragma: no cover
+ if e.errno not in (errno.ENOENT, errno.EISDIR):
+ raise
self.fs.remove(pathname)
def commit(self, skip=[]):