Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif self.duplicate_action == "longest":
if len(rec) > len(self.index[key]):
self.index[key] = rec
elif self.duplicate_action == "shortest":
if len(rec) < len(self.index[key]):
self.index[key] = rec
elif self.duplicate_action == "drop":
if key not in drop_keys:
drop_keys.append(key)
else:
self.index[key] = rec
prev_bend = bend
for dup in drop_keys:
self.index.pop(dup, None)
except IOError:
raise IndexNotFoundError(
"Could not read index file %s" % self.indexname)