Preserve input file order using list instead of set (#1209)

* Preserve input file order using list instead of set

* Simplify list comprehension and fix append for sources

* Remove redundant list() conversion
This commit is contained in:
フィルターペーパー
2026-01-05 20:52:53 -08:00
committed by GitHub
parent 8e42fc1162
commit 7897627c43
+3 -3
View File
@@ -65,16 +65,16 @@ def main(argv=None):
parser.print_help() parser.print_help()
return 0 return 0
if sys.platform.startswith('win'): if sys.platform.startswith('win'):
sources = set([source for option in options.input for source in glob(escape(option))]) sources = [source for option in options.input for source in glob(escape(option))]
else: else:
sources = set(options.input) sources = options.input
if len(sources) == 0: if len(sources) == 0:
print('No matching files found.') print('No matching files found.')
return 1 return 1
if options.filefusion: if options.filefusion:
fusion_path = makeFusion(list(sources)) fusion_path = makeFusion(list(sources))
sources.clear() sources.clear()
sources.add(fusion_path) sources.append(fusion_path)
for source in sources: for source in sources:
source = source.rstrip('\\').rstrip('/') source = source.rstrip('\\').rstrip('/')
options = copy(args) options = copy(args)