scripts: set_assignee: handle exceptions

Deal with exceptions that happen when a user does not exist on GH.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2022-07-18 19:37:31 -04:00
commit 6027152408

View file

@ -9,6 +9,7 @@ import os
import time
import datetime
from github import Github, GithubException
from github.GithubException import UnknownObjectException
from collections import defaultdict
TOP_DIR = os.path.join(os.path.dirname(__file__))
@ -155,10 +156,13 @@ def process_pr(gh, maintainer_file, number):
page += 1
for c in collab:
u = gh.get_user(c)
if pr.user != u and gh_repo.has_in_collaborators(u):
if u not in existing_reviewers:
reviewers.append(c)
try:
u = gh.get_user(c)
if pr.user != u and gh_repo.has_in_collaborators(u):
if u not in existing_reviewers:
reviewers.append(c)
except UnknownObjectException as e:
log(f"Can't get user '{c}', account does not exist anymore? ({e})")
if reviewers:
try: