From 350afb0879f1ebb03da6de7e6d56a5a77b20a361 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Wed, 6 Nov 2024 14:50:31 +0100 Subject: [PATCH] chore(lint): fix pylint errors --- src/tito/builder/submodule_aware_builder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tito/builder/submodule_aware_builder.py b/src/tito/builder/submodule_aware_builder.py index 6ec779b7..d49c30fa 100644 --- a/src/tito/builder/submodule_aware_builder.py +++ b/src/tito/builder/submodule_aware_builder.py @@ -152,12 +152,12 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz): timestamp = get_commit_timestamp(commit) # Accommodate standalone projects with specfile in root of git repo: - relative_git_dir = "%s" % relative_dir + relative_git_dir = str(relative_dir) if relative_git_dir in ["/", "./"]: relative_git_dir = "" basename = os.path.splitext(dest_tgz)[0] - initial_tar = "%s.initial" % basename + initial_tar = f"{basename}.initial" # We need to tar up the following: # 1. the current repo @@ -166,11 +166,11 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz): # 2. all of the submodules # then combine those into a single archive. for submodule_tar_file in self._submodule_archives( - relative_git_dir, prefix, commit, initial_tar + relative_git_dir, prefix, initial_tar ): - run_command("tar -Af %s %s" % (initial_tar, submodule_tar_file)) + run_command(f"tar -Af {initial_tar} {submodule_tar_file}") - fixed_tar = "%s.tar" % basename + fixed_tar = f"{basename}.tar" fixed_tar_fh = open(fixed_tar, "wb") try: tarfixer = TarFixer( @@ -181,4 +181,4 @@ def create_tgz(self, git_root, prefix, commit, relative_dir, dest_tgz): fixed_tar_fh.close() # It's a pity we can't use Python's gzip, but it doesn't offer an equivalent of -n - return run_command("gzip -n -c < %s > %s" % (fixed_tar, dest_tgz)) + return run_command(f"gzip -n -c < {fixed_tar} > {dest_tgz}")