@@ -38,14 +38,14 @@ def run_cmd(cmd, silent=False, shell=False, **kwargs):
3838 if shell :
3939 cmd = SPACE .join (cmd )
4040 if not silent :
41- print ("Executing %s" % cmd )
41+ print (f "Executing { cmd } " )
4242 try :
4343 if silent :
4444 subprocess .check_call (cmd , shell = shell , stdout = subprocess .PIPE , ** kwargs )
4545 else :
4646 subprocess .check_call (cmd , shell = shell , ** kwargs )
4747 except subprocess .CalledProcessError :
48- error ("%s failed" % cmd )
48+ error (f" { cmd } failed" )
4949
5050
5151readme_re = re .compile (r"This is Python version [23]\.\d" ).match
@@ -186,7 +186,7 @@ def constant_replace(fn, updated_constants, comment_start="/*", comment_end="*/"
186186 else :
187187 outfile .write (line )
188188 if not found_constants :
189- error ("Constant section delimiters not found: %s" % fn )
189+ error (f "Constant section delimiters not found: { fn } " )
190190 os .rename (fn + ".new" , fn )
191191
192192
@@ -217,7 +217,7 @@ def tweak_patchlevel(tag, done=False):
217217
218218
219219def bump (tag ):
220- print ("Bumping version to %s" % tag )
220+ print (f "Bumping version to { tag } " )
221221
222222 tweak_patchlevel (tag )
223223
@@ -240,10 +240,10 @@ def bump(tag):
240240 print ("\n Manual editing time..." )
241241 for fn in other_files :
242242 if os .path .exists (fn ):
243- print ("Edit %s" % fn )
243+ print (f "Edit { fn } " )
244244 manual_edit (fn )
245245 else :
246- print ("Skipping %s" % fn )
246+ print (f "Skipping { fn } " )
247247
248248 print ("Bumped revision" )
249249 if extra_work :
@@ -258,7 +258,7 @@ def manual_edit(fn: str) -> None:
258258
259259@contextmanager
260260def pushd (new ):
261- print ("chdir'ing to %s" % new )
261+ print (f "chdir'ing to { new } " )
262262 old = os .getcwd ()
263263 os .chdir (new )
264264 try :
@@ -272,11 +272,11 @@ def make_dist(name):
272272 os .mkdir (name )
273273 except OSError :
274274 if os .path .isdir (name ):
275- print ("WARNING: dist dir %s already exists" % name , file = sys .stderr )
275+ print (f "WARNING: dist dir { name } already exists" , file = sys .stderr )
276276 else :
277- error ("%s / is not a directory" % name )
277+ error (f" { name } / is not a directory" )
278278 else :
279- print ("created dist directory %s" % name )
279+ print (f "created dist directory { name } " )
280280
281281
282282def tarball (source , clamp_mtime ):
@@ -330,25 +330,25 @@ def tarball(source, clamp_mtime):
330330def export (tag , silent = False , skip_docs = False ):
331331 make_dist (tag .text )
332332 print ("Exporting tag:" , tag .text )
333- archivename = "Python-%s" % tag .text
333+ archivename = f "Python-{ tag .text } "
334334 # I have not figured out how to get git to directly produce an
335335 # archive directory like hg can, so use git to produce a temporary
336336 # tarball then expand it with tar.
337- archivetempfile = "%s .tar" % archivename
337+ archivetempfile = f" { archivename } .tar"
338338 run_cmd (
339339 [
340340 "git" ,
341341 "archive" ,
342342 "--format=tar" ,
343- "--prefix=%s/" % archivename ,
343+ f "--prefix={ archivename } /" ,
344344 "-o" ,
345345 archivetempfile ,
346346 tag .gitname ,
347347 ],
348348 silent = silent ,
349349 )
350350 with pushd (tag .text ):
351- archivetempfile = "../%s" % archivetempfile
351+ archivetempfile = f "../{ archivetempfile } "
352352 run_cmd (["tar" , "-xf" , archivetempfile ], silent = silent )
353353 os .unlink (archivetempfile )
354354 with pushd (archivename ):
@@ -446,7 +446,7 @@ def export(tag, silent=False, skip_docs=False):
446446 os .mkdir ("src" )
447447 tarball (archivename , tag .committed_at .strftime ("%Y-%m-%d %H:%M:%SZ" ))
448448 print ()
449- print ("**Now extract the archives in %s /src and run the tests**" % tag . text )
449+ print (f "**Now extract the archives in { tag . text } /src and run the tests**" )
450450 print ("**You may also want to run make install and re-test**" )
451451
452452
@@ -469,16 +469,16 @@ def build_docs():
469469
470470def upload (tag , username ):
471471 """scp everything to dinsdale"""
472- address = '"%s @dinsdale.python.org:' % username
472+ address = f'" { username } @dinsdale.python.org:'
473473
474474 def scp (from_loc , to_loc ):
475475 run_cmd (["scp" , from_loc , address + to_loc ])
476476
477477 with pushd (tag .text ):
478478 print ("Uploading source tarballs" )
479- scp ("src" , "/data/python-releases/%s" % tag .nickname )
479+ scp ("src" , f "/data/python-releases/{ tag .nickname } " )
480480 print ("Upload doc tarballs" )
481- scp ("docs" , "/data/python-releases/doc/%s" % tag .nickname )
481+ scp ("docs" , f "/data/python-releases/doc/{ tag .nickname } " )
482482 print (
483483 "* Now change the permissions on the tarballs so they are "
484484 "writable by the webmaster group. *"
@@ -495,7 +495,7 @@ def __init__(self, tag_name):
495495 tag_name = os .path .basename (os .getcwd ())
496496 result = tag_cre .match (tag_name )
497497 if result is None :
498- error ("tag %s is not valid" % tag_name )
498+ error (f "tag { tag_name } is not valid" )
499499 data = list (result .groups ())
500500 if data [3 ] is None :
501501 # A final release.
0 commit comments