def get_latest_release(repo):
    """Get the latest release for a repo, or throw an error if no releases exist.
    Uses the following GitHub API:
      https://developer.github.com/v3/repos/releases/#get-the-latest-release
    """
    # Again this implementation assumes inner workings of PyGithub because the
    # API isn't implemented yet in PyGithub.
    headers, data = repo._requester.requestJsonAndCheck(
        "GET",
        repo.url + "/releases/latest"
    )
    return headers, data