From 563276a7a70a07423ff7e6cf3131f5f2ab89ff9a Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Tue, 25 Feb 2020 14:34:03 -0700 Subject: [PATCH] Ignore it when we can't access the URL for a commit Works around #84. --- sympy_bot/webapp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sympy_bot/webapp.py b/sympy_bot/webapp.py index d2c5595..3960cf0 100644 --- a/sympy_bot/webapp.py +++ b/sympy_bot/webapp.py @@ -87,7 +87,11 @@ async def pull_request_comment(event, gh): header_in_message = commit['sha'] # Workaround https://github.com/sympy/sympy-bot/issues/84 - com = await gh.getitem(f"https://api.github.com/repos/sympy/sympy/commits/{commit['sha']}") + try: + com = await gh.getitem(commit['url']) + except BadRequest: + print(f"Warning: could not get commit {commit['sha']}") + continue if len(com['parents']) > 1: # Merge commit continue