[ez][TD] Fix request for issue body returns None (#135389)

I assumed it would be empty string if the body is empty, but its just None
Pull Request resolved: https://github.com/pytorch/pytorch/pull/135389
Approved by: https://github.com/malfet
This commit is contained in:
Catherine Lee
2024-09-06 21:02:01 +00:00
committed by PyTorch MergeBot
parent a7643baceb
commit 306ac44eaa

View File

@ -116,7 +116,7 @@ def get_issue_or_pr_body(number: int) -> str:
# Despite the 'issues' in the link, this also works for PRs
url = f"https://api.github.com/repos/pytorch/pytorch/issues/{number}"
with urlopen(Request(url, headers=headers)) as conn:
body: str = json.loads(conn.read().decode())["body"]
body: str = json.loads(conn.read().decode())["body"] or ""
return body