diff --git a/tools/get_pr_ut.py b/tools/get_pr_ut.py index d8440ad048939313c696085b2ec59187422b6a83..81d02b996842b1e9376b1d11ac67a26b2e8953e9 100644 --- a/tools/get_pr_ut.py +++ b/tools/get_pr_ut.py @@ -60,12 +60,15 @@ class PRChecker(object): last_commit = None ix = 0 while True: - commits = self.pr.get_commits().get_page(ix) - for c in commits: - last_commit = c.commit - else: + try: + commits = self.pr.get_commits().get_page(ix) + if len(commits) == 0: + raise ValueError("no commit found in {} page".format(ix)) + last_commit = commits[-1].commit + except Exception as e: break - ix = ix + 1 + else: + ix = ix + 1 if last_commit.message.find('test=allcase') != -1: print('PREC test=allcase is set') self.full_case = True