def METHOD_NAME(self, prunedir: str) -> None:
    """Handle pruning empty directories."""
    # Walk the tree bottom-up so we can properly kill recursive empty dirs.
    for basename, dirnames, filenames in os.walk(prunedir, topdown=False):
        # It seems that child dirs we kill during the walk are still
        # listed when the parent dir is visited, so lets make sure
        # to only acknowledge still-existing ones.
        dirnames = [
            d for d in dirnames if os.path.exists(os.path.join(basename, d))
        ]
        if not dirnames and not filenames and basename != prunedir:
            os.rmdir(basename)