replace os.listdir by os.scandir

This commit is contained in:
MustafaJafar 2025-02-11 20:28:03 +02:00
parent bba0df9c0e
commit 99f60e1012

View file

@ -136,8 +136,8 @@ def version_up(filepath):
index += len(new_label)
clash_basename = clash_basename[:index]
for file in os.listdir(dirname):
if file.endswith(ext) and file.startswith(clash_basename):
for file in os.scandir(dirname):
if file.name.endswith(ext) and file.name.startswith(clash_basename):
log.info("Skipping existing version %s" % new_label)
return version_up(new_filename)