FileList handle exception when deleting old/unused file

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-13 18:01:46 +02:00
parent 589b5a68b9
commit e70e0569ec

View file

@ -43,7 +43,11 @@ class FileList(collections.MutableSequence):
self.path = path
if initial:
# delete existing file
os.unlink(self.path)
try:
os.unlink(self.path)
except EnvironmentError:
# ignored
pass
for i in initial:
self.append(i)