@@ -38,14 +38,14 @@ def run_cmd(cmd, silent=False, shell=False, **kwargs):
38
38
if shell :
39
39
cmd = SPACE .join (cmd )
40
40
if not silent :
41
- print ("Executing %s" % cmd )
41
+ print (f "Executing { cmd } " )
42
42
try :
43
43
if silent :
44
44
subprocess .check_call (cmd , shell = shell , stdout = subprocess .PIPE , ** kwargs )
45
45
else :
46
46
subprocess .check_call (cmd , shell = shell , ** kwargs )
47
47
except subprocess .CalledProcessError :
48
- error ("%s failed" % cmd )
48
+ error (f" { cmd } failed" )
49
49
50
50
51
51
readme_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="*/"
186
186
else :
187
187
outfile .write (line )
188
188
if not found_constants :
189
- error ("Constant section delimiters not found: %s" % fn )
189
+ error (f "Constant section delimiters not found: { fn } " )
190
190
os .rename (fn + ".new" , fn )
191
191
192
192
@@ -217,7 +217,7 @@ def tweak_patchlevel(tag, done=False):
217
217
218
218
219
219
def bump (tag ):
220
- print ("Bumping version to %s" % tag )
220
+ print (f "Bumping version to { tag } " )
221
221
222
222
tweak_patchlevel (tag )
223
223
@@ -240,10 +240,10 @@ def bump(tag):
240
240
print ("\n Manual editing time..." )
241
241
for fn in other_files :
242
242
if os .path .exists (fn ):
243
- print ("Edit %s" % fn )
243
+ print (f "Edit { fn } " )
244
244
manual_edit (fn )
245
245
else :
246
- print ("Skipping %s" % fn )
246
+ print (f "Skipping { fn } " )
247
247
248
248
print ("Bumped revision" )
249
249
if extra_work :
@@ -258,7 +258,7 @@ def manual_edit(fn: str) -> None:
258
258
259
259
@contextmanager
260
260
def pushd (new ):
261
- print ("chdir'ing to %s" % new )
261
+ print (f "chdir'ing to { new } " )
262
262
old = os .getcwd ()
263
263
os .chdir (new )
264
264
try :
@@ -272,11 +272,11 @@ def make_dist(name):
272
272
os .mkdir (name )
273
273
except OSError :
274
274
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 )
276
276
else :
277
- error ("%s / is not a directory" % name )
277
+ error (f" { name } / is not a directory" )
278
278
else :
279
- print ("created dist directory %s" % name )
279
+ print (f "created dist directory { name } " )
280
280
281
281
282
282
def tarball (source , clamp_mtime ):
@@ -330,25 +330,25 @@ def tarball(source, clamp_mtime):
330
330
def export (tag , silent = False , skip_docs = False ):
331
331
make_dist (tag .text )
332
332
print ("Exporting tag:" , tag .text )
333
- archivename = "Python-%s" % tag .text
333
+ archivename = f "Python-{ tag .text } "
334
334
# I have not figured out how to get git to directly produce an
335
335
# archive directory like hg can, so use git to produce a temporary
336
336
# tarball then expand it with tar.
337
- archivetempfile = "%s .tar" % archivename
337
+ archivetempfile = f" { archivename } .tar"
338
338
run_cmd (
339
339
[
340
340
"git" ,
341
341
"archive" ,
342
342
"--format=tar" ,
343
- "--prefix=%s/" % archivename ,
343
+ f "--prefix={ archivename } /" ,
344
344
"-o" ,
345
345
archivetempfile ,
346
346
tag .gitname ,
347
347
],
348
348
silent = silent ,
349
349
)
350
350
with pushd (tag .text ):
351
- archivetempfile = "../%s" % archivetempfile
351
+ archivetempfile = f "../{ archivetempfile } "
352
352
run_cmd (["tar" , "-xf" , archivetempfile ], silent = silent )
353
353
os .unlink (archivetempfile )
354
354
with pushd (archivename ):
@@ -446,7 +446,7 @@ def export(tag, silent=False, skip_docs=False):
446
446
os .mkdir ("src" )
447
447
tarball (archivename , tag .committed_at .strftime ("%Y-%m-%d %H:%M:%SZ" ))
448
448
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**" )
450
450
print ("**You may also want to run make install and re-test**" )
451
451
452
452
@@ -469,16 +469,16 @@ def build_docs():
469
469
470
470
def upload (tag , username ):
471
471
"""scp everything to dinsdale"""
472
- address = '"%s @dinsdale.python.org:' % username
472
+ address = f'" { username } @dinsdale.python.org:'
473
473
474
474
def scp (from_loc , to_loc ):
475
475
run_cmd (["scp" , from_loc , address + to_loc ])
476
476
477
477
with pushd (tag .text ):
478
478
print ("Uploading source tarballs" )
479
- scp ("src" , "/data/python-releases/%s" % tag .nickname )
479
+ scp ("src" , f "/data/python-releases/{ tag .nickname } " )
480
480
print ("Upload doc tarballs" )
481
- scp ("docs" , "/data/python-releases/doc/%s" % tag .nickname )
481
+ scp ("docs" , f "/data/python-releases/doc/{ tag .nickname } " )
482
482
print (
483
483
"* Now change the permissions on the tarballs so they are "
484
484
"writable by the webmaster group. *"
@@ -495,7 +495,7 @@ def __init__(self, tag_name):
495
495
tag_name = os .path .basename (os .getcwd ())
496
496
result = tag_cre .match (tag_name )
497
497
if result is None :
498
- error ("tag %s is not valid" % tag_name )
498
+ error (f "tag { tag_name } is not valid" )
499
499
data = list (result .groups ())
500
500
if data [3 ] is None :
501
501
# A final release.
0 commit comments