mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[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:
committed by
PyTorch MergeBot
parent
a7643baceb
commit
306ac44eaa
@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user