def delete_directory_if_empty(self, directory_path):
        try:
            os.rmdir(directory_path)
            return True
        except OSError:
            pass

        return False
Delete a directory only if it's empty.
dataset/ETHPy150Open jmathai/elodie/elodie/filesystem.py/FileSystem.delete_directory_if_empty