8000
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -215,9 +215,7 @@ def create_comment(self, body):
215
215
:param str body: (required), comment body
216
216
:returns: :class:`IssueComment <github3.issues.comment.IssueComment>`
217
217
"""
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 ()
221
219
return issue .create_comment (body )
222
220
223
221
@requires_auth
@@ -256,6 +254,14 @@ def is_merged(self):
256
254
url = self ._build_url ('merge' , base_url = self ._api )
257
255
return self ._boolean (self ._get (url ), 204 , 404 )
258
256
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
+
259
265
def commits (self , number = - 1 , etag = None ):
260
266
r"""Iterate over the commits on this pull request.
261
267
You can’t perform that action at this time.
0 commit comments