Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_file_stats(path, encodings, stat_cache):
# Primary file has an encoding of None
files = {None: FileEntry(path, stat_cache)}
if encodings:
for encoding, alt_path in encodings.items():
try:
files[encoding] = FileEntry(alt_path, stat_cache)
except MissingFileError:
continue
return files
def get_file_stats(path, encodings, stat_cache):
# Primary file has an encoding of None
files = {None: FileEntry(path, stat_cache)}
if encodings:
for encoding, alt_path in encodings.items():
try:
files[encoding] = FileEntry(alt_path, stat_cache)
except MissingFileError:
continue
return files