1import os
2def drop_empty_folders(directory):
3 """Verify that every empty folder removed in local storage."""
4
5 for dirpath, dirnames, filenames in os.walk(directory, topdown=False):
6 if not dirnames and not filenames:
7 os.rmdir(dirpath)