silently ignore error when deleting nonexistent file

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-11 14:21:47 +02:00
parent 19ad2fe4a9
commit d7adff4e21
1 changed files with 5 additions and 1 deletions

View File

@ -134,7 +134,11 @@ class FileListProperty(FileList):
def __set__(self, obj, value):
self._set_path(obj)
os.unlink(self.path)
try:
os.unlink(self.path)
except EnvironmentError:
# ignored
pass
for item in value:
self.append(item)