if not isinstance(entry, tuple):
logger.info("TOC found a %s, not a tuple", entry)
raise TypeError("Expected tuple, not %s." % type(entry).__name__)
name, path, typecode = entry
if name not in self.filenames:
self.filenames.add(name)
super(TOC, self).append((name, path, typecode))
After Change
logger.info("TOC found a %s, not a tuple", entry)
raise TypeError("Expected tuple, not %s." % type(entry).__name__)
unique = unique_name(entry)
if unique not in self.filenames:
self.filenames.add(unique)
super(TOC, self).append(entry)