aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/services
diff options
context:
space:
mode:
authorNat Williams <nwilliams@leapfrogonline.com>2012-04-19 09:57:34 -0500
committerNat Williams <nwilliams@leapfrogonline.com>2012-04-19 09:57:34 -0500
commit9008296715194c150e7eeb16469005d771f7d370 (patch)
tree62fe10a0a0dd6f5738de0cd7f47ac3c7b670dbc1 /pygithub3/services
parentmerge request won't json encode body without schema (diff)
downloadpython-github3-9008296715194c150e7eeb16469005d771f7d370.tar.xz
python-github3-9008296715194c150e7eeb16469005d771f7d370.zip
use _bool for pull request merge status
Diffstat (limited to '')
-rw-r--r--pygithub3/services/pull_requests/__init__.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/pygithub3/services/pull_requests/__init__.py b/pygithub3/services/pull_requests/__init__.py
index f7da50a..66d9e58 100644
--- a/pygithub3/services/pull_requests/__init__.py
+++ b/pygithub3/services/pull_requests/__init__.py
@@ -95,23 +95,10 @@ class PullRequests(Service, MimeTypeMixin):
:param str repo: Repository
"""
- # for this to work with a proper Resource, we would need to pass the
- # response's status code to the Resource constructor, and that's kind
- # of scary
- try:
- resp = self._client.get(
- self.make_request('pull_requests.merge_status', number=number,
- user=user, repo=repo)
- )
- except NotFound:
- return False
- code = resp.status_code
- if code == 204:
- return True
- # TODO: more flexible way to return arbitrary objects based on
- # response. Probably something on Request
- raise BadRequest('got code %s: %s' % (code, resp.content))
- # again, I'm sorry.
+ return self._bool(
+ self.make_request('pull_requests.merge_status', number=number,
+ user=user, repo=repo)
+ )
def merge(self, number, message='', user=None, repo=None):
"""Merge a pull request.