From 6143a9473b756f90b486226a93f0afbf4ffaa92e Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Thu, 8 Jul 2021 17:06:27 +0000 Subject: [PATCH] Add python3 support to tryserver recipe module Bug: 1227140 Change-Id: I54b9fb426e0471543be6c7801f5d5f76ff21c6f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3010715 Reviewed-by: Anthony Polito Commit-Queue: Gavin Mak --- recipes/README.recipes.md | 6 +++--- recipes/recipe_modules/tryserver/api.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index c2fb7e371..be01959ca 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -879,7 +879,7 @@ Args: Returned paths will be relative to to patch_root. -— **def [get\_footer](/recipes/recipe_modules/tryserver/api.py#333)(self, tag, patch_text=None):** +— **def [get\_footer](/recipes/recipe_modules/tryserver/api.py#334)(self, tag, patch_text=None):** Gets a specific tag from a CL description @@ -902,9 +902,9 @@ Returns true iff the properties exist to match a Gerrit issue. Returns true iff we have a change to check out. -— **def [normalize\_footer\_name](/recipes/recipe_modules/tryserver/api.py#341)(self, footer):** +— **def [normalize\_footer\_name](/recipes/recipe_modules/tryserver/api.py#342)(self, footer):** -— **def [set\_change](/recipes/recipe_modules/tryserver/api.py#344)(self, change):** +— **def [set\_change](/recipes/recipe_modules/tryserver/api.py#345)(self, change):** Set the gerrit change for this module. diff --git a/recipes/recipe_modules/tryserver/api.py b/recipes/recipe_modules/tryserver/api.py index ac0c5cad2..2d60885ec 100644 --- a/recipes/recipe_modules/tryserver/api.py +++ b/recipes/recipe_modules/tryserver/api.py @@ -321,7 +321,8 @@ class TryserverApi(recipe_api.RecipeApi): self._ensure_gerrit_commit_message() self._change_footers = self._get_footer_step(self._gerrit_commit_message) return self._change_footers - raise "No patch text or associated changelist, cannot get footers" #pragma: nocover + raise Exception( + 'No patch text or associated changelist, cannot get footers') #pragma: nocover def _get_footer_step(self, patch_text): result = self.m.python(