Skip to content

Commit

Permalink
Use de-dupe idiom that works with Python 3.6, refs #1632
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Feb 7, 2022
1 parent 0b1aa9d commit 5619069
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datasette/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ def serve(
)

# De-duplicate files so 'datasette db.db db.db' only attaches one /db
files = list(dict.fromkeys(files))
files_seen = set()
deduped_files = [f for f in files if f not in files_seen and not files_seen.add(f)]
files = deduped_files

try:
ds = Datasette(files, **kwargs)
Expand Down

0 comments on commit 5619069

Please sign in to comment.