8000 Added issue retrieval method for pull requessts · Teino1978-Corp/github3.py@6964f39 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 6964f39

Browse files
committed
Added issue retrieval method for pull requessts
1 parent 175bf21 commit 6964f39

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

github3/pulls.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ def create_comment(self, body):
215215
:param str body: (required), comment body
216216
:returns: :class:`IssueComment <github3.issues.comment.IssueComment>`
217217
"""
218-
response = self._get(self.issue_url)
219-
json = self._json(response, 200)
220-
issue = self._instance_or_null(Issue, json)
218+
issue = self.issue()
221219
return issue.create_comment(body)
222220

223221
@requires_auth
@@ -256,6 +254,14 @@ def is_merged(self):
256254
url = self._build_url('merge', base_url=self._api)
257255
return self._boolean(self._get(url), 204, 404)
258256

257+
def issue(self):
258+
"""Retrieve the issue associated with this pull request.
259+
260+
:returns: :class:`~github3.issues.Issue`
261+
"""
262+
json = self._json(self._get(self.issue_url), 200)
263+
return self._instance_or_null(Issue, json)
264+
259265
def commits(self, number=-1, etag=None):
260266
r"""Iterate over the commits on this pull request.
261267

0 commit comments

Comments
 (0)
0