Could `os.removedirs()` be employed here instead?