AttributeError: 'PullRequest' object has no attribute 'issue_comments'

I am using https://github.com/sigmavirus24/github3.py

and I'm having a problem getting problem_messages from PR.

for pr in repo.iter_pulls():
    for comment in pr.issue_comments():
        print comment

      

I get

AttributeError: 'PullRequest' object has no attribute 'issue_comments'

What am I doing wrong here? review_comments for example works just fine

+3


source to share


1 answer


The method review_comments

was recently added and has been pushed back from the next planned github3.py release (1.0). When it was backported to reduce migration headaches from 0.9.x to 1.0, we decided not to prefix it with iter_

, like other similar methods. In short, the method that you are looking for is: iter_issue_comments

.

The following should work



TEMPLATE = """{0.user} commented on #{0.number} at {0.created_at} saying:

{0.body}
"""

for pr in repo.iter_pulls()
    for comment in pr.iter_issue_comments():
        print(TEMPLATE.format(comment))

      

0


source







All Articles