def remove_empty_directory(directory_path): try: os.rmdir(directory_path) return True except OSError: return False