diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-04-23 09:28:17 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-04-23 09:28:17 +0100 |
commit | ea79516de482f4867f243afd3c30f552b2f7fae7 (patch) | |
tree | 4f3594108965e8465662e6ab6581ef53723caf8c | |
parent | 69591ee375dcff4d48c5f9a9a4e00eb7c9a31cff (diff) | |
download | larch-ea79516de482f4867f243afd3c30f552b2f7fae7.tar.gz |
Ignore missing files, directories, when removing stuff
-rw-r--r-- | larch/journal.py | 5 |
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=[]): |