3

I'm using https://github.com/sigmavirus24/github3.py

and I'm having problem with getting issue_comments from PR.

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

I'm getting

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

What I'm doing wrong here? review_comments for example is working just fine

mihazelnik
  • 33
  • 2

1 Answers1

0

The review_comments method was added very recently and was backported from the next planned version of github3.py (1.0). When it was backported, to reduce migration headaches from 0.9.x to 1.0, we decided to not prefix it with iter_ like the other similar methods. In short, the method 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))
Ian Stapleton Cordasco
  • 26,944
  • 4
  • 67
  • 72