Skip to content

Commit 830b36c

Browse files
committed
Merge #121: github-merge: Use format strings to fix TypeError exception
b6c26db github-merge: Use format strings to fix TypeError exception (MarcoFalke) Pull request description: ACKs for top commit: fanquake: ACK b6c26db Tree-SHA512: 073e51218914e89288fdb7f3d1314839b9df187b4decb8ff4e627fb6daa0895c4f03596311db8d19b84ac2f3e6fb7c6f4d8a0f8a3bd21f2a140520c78049b2df
2 parents 9b17057 + b6c26db commit 830b36c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

github-merge.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,25 +331,25 @@ def main():
331331
try:
332332
subprocess.check_call([GIT,'checkout','-q',branch])
333333
except subprocess.CalledProcessError:
334-
print("ERROR: Cannot check out branch %s." % (branch), file=stderr)
334+
print(f"ERROR: Cannot check out branch {branch}.", file=stderr)
335335
sys.exit(3)
336336
try:
337337
subprocess.check_call([GIT,'fetch','-q',host_repo_from,'+refs/pull/'+pull+'/*:refs/heads/pull/'+pull+'/*',
338338
'+refs/heads/'+branch+':refs/heads/'+base_branch])
339339
except subprocess.CalledProcessError:
340-
print("ERROR: Cannot find pull request {} or branch {} on {}.".format(pull_reference,branch,host_repo_from), file=stderr)
340+
print(f"ERROR: Cannot find pull request {pull_reference} or branch {branch} on {host_repo_from}.", file=stderr)
341341
sys.exit(3)
342342
try:
343343
subprocess.check_call([GIT,'--no-pager','log','-q','-1','refs/heads/'+head_branch], stdout=devnull, stderr=stdout)
344344
head_commit = subprocess.check_output([GIT,'--no-pager','log','-1','--pretty=format:%H',head_branch]).decode('utf-8')
345345
assert len(head_commit) == 40
346346
except subprocess.CalledProcessError:
347-
print("ERROR: Cannot find head of pull request {} on {}.".format(pull_reference,host_repo_from), file=stderr)
347+
print(f"ERROR: Cannot find head of pull request {pull_reference} on {host_repo_from}.", file=stderr)
348348
sys.exit(3)
349349
try:
350350
subprocess.check_call([GIT,'--no-pager','log','-q','-1','refs/heads/'+merge_branch], stdout=devnull, stderr=stdout)
351351
except subprocess.CalledProcessError:
352-
print("ERROR: Cannot find merge of pull request {} on {}." % (pull_reference,host_repo_from), file=stderr)
352+
print(f"ERROR: Cannot find merge of pull request {pull_reference} on {host_repo_from}.", file=stderr)
353353
sys.exit(3)
354354
subprocess.check_call([GIT,'checkout','-q',base_branch])
355355
subprocess.call([GIT,'branch','-q','-D',local_merge_branch], stderr=devnull)
@@ -380,7 +380,7 @@ def main():
380380

381381
symlink_files = get_symlink_files()
382382
for f in symlink_files:
383-
print("ERROR: File %s was a symlink" % f)
383+
print(f"ERROR: File '{f}' was a symlink")
384384
if len(symlink_files) > 0:
385385
sys.exit(4)
386386

@@ -397,7 +397,7 @@ def main():
397397
# Run test command if configured.
398398
if testcmd:
399399
if subprocess.call(testcmd,shell=True):
400-
print("ERROR: Running %s failed." % testcmd,file=stderr)
400+
print(f"ERROR: Running '{testcmd}' failed.",file=stderr)
401401
sys.exit(5)
402402

403403
# Show the created merge.

0 commit comments

Comments
 (0)