diff --git a/github_api/__init__.py b/github_api/__init__.py index ac83838f..ad543381 100644 --- a/github_api/__init__.py +++ b/github_api/__init__.py @@ -101,6 +101,6 @@ def __call__(self, method, path, **kwargs): try: data = resp.json() except: - data = None + data = resp.text return data diff --git a/github_api/prs.py b/github_api/prs.py index 9dd67aaa..15d2ad86 100644 --- a/github_api/prs.py +++ b/github_api/prs.py @@ -330,11 +330,11 @@ def get_reactions_for_pr(api, urn, pr): def get_patch(api, urn, pr_num, raw=False): """ get the formatted or not patch file for a pr """ - path = "/{urn}/pull/{pr}.patch".format(urn=urn, pr=pr_num) + path = "https://github.com/{urn}/pull/{pr}.patch".format(urn=urn, pr=pr_num) data = api("get", path) if raw: return data - return PatchSet(data) + return PatchSet.from_string(data) def post_accepted_status(api, urn, pr, voting_window, votes, total, threshold,