Use a set() to eliminate duplicates when searching for deletable files.
This fixes the OSError that happens when the file cannot be found because
it was already deleted.
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
DELETE_REGEX = config.get_value ('regular expressions', 'delete_regex')
dregex = re.compile (DELETE_REGEX, re.IGNORECASE)
- return [f for f in likely if dregex.match (f)]
+ dfiles = [f for f in likely if dregex.match (f)]
+ dset = set(dfiles) # to eliminate dupes
+ return list(dset)
def printlist (li):
for f in li: