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:
@@ -1201,7 +1201,7 @@ def removeNonImages(filetree):
|
||||
os.remove(os.path.join(root, name))
|
||||
# remove empty nested folders
|
||||
for root, dirs, files in os.walk(filetree, False):
|
||||
if not files and not dirs:
|
||||
if not os.listdir(root):
|
||||
os.rmdir(root)
|
||||
|
||||
if not os.listdir(Path(filetree).parent):
|
||||
|
||||
Reference in New Issue
Block a user