1
0
mirror of https://github.com/ciromattia/kcc synced 2026-07-11 15:33:17 +00:00

don't crash on empty nested folders (#1388)

This commit is contained in:
Alex Xu
2026-07-08 17:46:46 -07:00
committed by GitHub
parent 0c1071a358
commit ca14a4c813
+1 -1
View File
@@ -1201,7 +1201,7 @@ def removeNonImages(filetree):
os.remove(os.path.join(root, name)) os.remove(os.path.join(root, name))
# remove empty nested folders # remove empty nested folders
for root, dirs, files in os.walk(filetree, False): for root, dirs, files in os.walk(filetree, False):
if not files and not dirs: if not os.listdir(root):
os.rmdir(root) os.rmdir(root)
if not os.listdir(Path(filetree).parent): if not os.listdir(Path(filetree).parent):