Skip to content

Commit

Permalink
chore: Use scandir instead of listdir
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 25, 2023
1 parent dfe4ab1 commit 9e4dea4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocdsextensionregistry/commands/generate_data_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def handle(self):
headers = ['Title', 'Description', 'Extension']

if localedir:
available_translations = [n for n in os.listdir(localedir) if os.path.isdir(os.path.join(localedir, n))]
available_translations = [entry.name for entry in os.scandir(localedir) if entry.is_dir()]
if self.args.languages:
for language in self.args.languages.split(','):
if language in available_translations:
Expand Down

0 comments on commit 9e4dea4

Please sign in to comment.