Skip to content

Commit

Permalink
CONTRIB/PR_MERGE: Script fixes
Browse files Browse the repository at this point in the history
- Fix verbose print access to removed field
- Call destructor __del__ before exit to avoid access to unloaded module
  shutil
  • Loading branch information
yosefe committed Jan 17, 2022
1 parent 079b988 commit 1c6bc28
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions contrib/pr_merge_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def merge(self, commit):
self.repo.git.merge(self.base_commit, m='Merge %s' % commit)
if self.verbose:
print(" - merge of %s to %s is %s" %
(commit[:7], self.base_commit, str(self.repo.head.commit)[:7]))
(commit[:7], self.base_commit[:7],
str(self.repo.head.commit)[:7]))
return self.repo.head.commit

def parse_args(self, argv):
Expand Down Expand Up @@ -171,7 +172,8 @@ def main(self, argv):

if self.verbose:
print("comparing %s and %s when merged to %s" %
(self.approved_commit[:7], self.head_commit[:7], self.target_branch))
(self.approved_commit[:7], self.head_commit[:7],
self.base_commit[:7]))

merge_approved = self.merge(self.approved_commit)
merge_head = self.merge(self.head_commit)
Expand All @@ -182,9 +184,10 @@ def main(self, argv):
return 0

self.print_diff(diff)
self.remove_temp_dir()
return 1


if __name__ == "__main__":
checker = PRChecker()
sys.exit(checker.main(sys.argv))
rc = PRChecker().main(sys.argv)
sys.exit(rc)

0 comments on commit 1c6bc28

Please sign in to comment.