From b6b5b6fb1259f9379c800eeb65d948fdd14c549c Mon Sep 17 00:00:00 2001 From: Jan Klass Date: Sun, 7 Mar 2021 23:25:42 +0100 Subject: MAINT: Fix output on git command failures in updatetranslations.py The previous code caused exceptions if git returned an error code. --- scripts/updatetranslations.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts/updatetranslations.py') diff --git a/scripts/updatetranslations.py b/scripts/updatetranslations.py index 618e2f91e..af66b26ef 100755 --- a/scripts/updatetranslations.py +++ b/scripts/updatetranslations.py @@ -35,18 +35,18 @@ def CheckForGitHasTsFileChanges(tsfiles: list) -> bool: def Commit(tsfiles: list) -> None: res = subprocess.run(["git", "reset", '--mixed'], capture_output=True) if res.returncode != 0: - logging.error('The git reset call returned an error status code ' + res.returncode) - logging.debug('stdout: ' + res.stdout) + logging.error('The git reset call returned an error status code %d', res.returncode) + logging.debug('stdout: %s', res.stdout) exit(1) res = subprocess.run(["git", "add"] + tsfiles, capture_output=True) if res.returncode != 0: - logging.error('The git add call returned an error status code ' + res.returncode) - logging.debug('stdout: ' + res.stdout) + logging.error('The git add call returned an error status code %d', res.returncode) + logging.debug('stdout: %s', res.stdout) exit(1) res = subprocess.run(["git", "commit", '-m', 'TRANSLATION: Update translation files'], capture_output=True) if res.returncode != 0: - logging.error('The git commit call returned an error status code ' + res.returncode) - logging.debug('stdout: ' + res.stdout) + logging.error('The git commit call returned an error status code %d', res.returncode) + logging.debug('stdout: %s', res.stdout) exit(1) def Update(lupdatebin, tsfile: str, debuglupdate: bool) -> (int, int, int): -- cgit v1.2.3