From b32ccbb66bb16965ecb8b4e266c4e45186636c1b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 29 Sep 2023 11:04:49 -0400 Subject: cleanup: Update codebase to expect Python 3.6 - Bump minimum version to Python 3.6. - Use f-strings in a lot of places. Change-Id: I2aa70197230fcec2eff8e7c8eb754f20c08075bb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389034 Tested-by: Jason R. Coombs Reviewed-by: Mike Frysinger Commit-Queue: Jason R. Coombs --- hooks.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'hooks.py') diff --git a/hooks.py b/hooks.py index 6ded08b9..82bf7e36 100644 --- a/hooks.py +++ b/hooks.py @@ -180,7 +180,7 @@ class RepoHook: abort_if_user_denies was passed to the consturctor. """ hooks_config = self._hooks_project.config - git_approval_key = "repo.hooks.%s.%s" % (self._hook_type, subkey) + git_approval_key = f"repo.hooks.{self._hook_type}.{subkey}" # Get the last value that the user approved for this hook; may be None. old_val = hooks_config.GetString(git_approval_key) @@ -193,7 +193,7 @@ class RepoHook: else: # Give the user a reason why we're prompting, since they last # told us to "never ask again". - prompt = "WARNING: %s\n\n" % (changed_prompt,) + prompt = f"WARNING: {changed_prompt}\n\n" else: prompt = "" @@ -241,9 +241,8 @@ class RepoHook: return self._CheckForHookApprovalHelper( "approvedmanifest", self._manifest_url, - "Run hook scripts from %s" % (self._manifest_url,), - "Manifest URL has changed since %s was allowed." - % (self._hook_type,), + f"Run hook scripts from {self._manifest_url}", + f"Manifest URL has changed since {self._hook_type} was allowed.", ) def _CheckForHookApprovalHash(self): @@ -262,7 +261,7 @@ class RepoHook: "approvedhash", self._GetHash(), prompt % (self._GetMustVerb(), self._script_fullpath), - "Scripts have changed since %s was allowed." % (self._hook_type,), + f"Scripts have changed since {self._hook_type} was allowed.", ) @staticmethod -- cgit v1.2.3-54-g00ecf