diff --git a/pull_requests.py b/pull_requests.py index dae7ea5..9683351 100644 --- a/pull_requests.py +++ b/pull_requests.py @@ -184,16 +184,16 @@ def get_files(pr: PullRequest, repo: Repository, repo_path: str) -> dict[str, Fi def get_comments(pr: PullRequest) -> list[Comment]: ret = [] for comment in pr.get_review_comments(): - comment = Comment( + comment_to_add = Comment( body=comment.body, file=comment.path, from_=comment.start_line if comment.start_line else comment.line, to=comment.line, ) - if comment.from_ is None or comment.to is None: - comment.to = comment.original_line - comment.from_ = comment.original_start_line - ret.append(comment) + if comment_to_add.from_ is None or comment_to_add.to is None: + comment_to_add.to = comment.original_line + comment_to_add.from_ = comment.original_start_line + ret.append(comment_to_add) return ret