192192 "source" : buildconfig .topobjdir ,
193193 "base" : "dist/bin" ,
194194 "patterns" : [
195- "%s%s" % (f , buildconfig .substs ["BIN_SUFFIX" ])
196- for f in TEST_HARNESS_BINS
195+ f"{ f } { buildconfig .substs ['BIN_SUFFIX' ]} " for f in TEST_HARNESS_BINS
197196 ]
198197 + [
199- "%s%s%s"
200- % (
201- buildconfig .substs ["DLL_PREFIX" ],
202- f ,
203- buildconfig .substs ["DLL_SUFFIX" ],
204- )
198+ f"{ buildconfig .substs ['DLL_PREFIX' ]} { f } { buildconfig .substs ['DLL_SUFFIX' ]} "
205199 for f in TEST_HARNESS_DLLS
206200 ],
207201 "dest" : "bin" ,
636630 {
637631 "source" : buildconfig .topobjdir ,
638632 "base" : "dist/bin" ,
639- "pattern" : "http3server%s" % buildconfig .substs [" BIN_SUFFIX" ] ,
633+ "pattern" : f "http3server{ buildconfig .substs [' BIN_SUFFIX' ] } " ,
640634 "dest" : "xpcshell/http3server" ,
641635 },
642636 {
708702 "source" : buildconfig .topobjdir ,
709703 "base" : "dist/bin" ,
710704 "patterns" : [
711- "%s%s" % (f , buildconfig .substs ["BIN_SUFFIX" ])
712- for f in TEST_HARNESS_BINS
705+ f"{ f } { buildconfig .substs ['BIN_SUFFIX' ]} " for f in TEST_HARNESS_BINS
713706 ]
714707 + [
715- "%s%s%s"
716- % (
717- buildconfig .substs ["DLL_PREFIX" ],
718- f ,
719- buildconfig .substs ["DLL_SUFFIX" ],
720- )
708+ f"{ buildconfig .substs ['DLL_PREFIX' ]} { f } { buildconfig .substs ['DLL_SUFFIX' ]} "
721709 for f in TRAIN_HOP_DLLS
722710 ],
723711 "dest" : "bin" ,
782770 itertools .chain (* (e .get ("ignore" , []) for e in ARCHIVE_FILES ["common" ]))
783771 )
784772
785- if not any (p .startswith ("%s/" % k ) for p in ignores ):
786- raise Exception ('"common" ignore list probably should contain %s' % k )
773+ if not any (p .startswith (f" { k } /" ) for p in ignores ):
774+ raise Exception (f '"common" ignore list probably should contain { k } ' )
787775
788776
789777def find_generated_harness_files ():
@@ -860,9 +848,8 @@ def find_files(archive):
860848 finder = FileFinder (os .path .join (source , base ), ** common_kwargs )
861849
862850 for pattern in patterns :
863- for p , f in finder .find (pattern ):
864- if dest :
865- p = mozpath .join (dest , p )
851+ for raw_p , f in finder .find (pattern ):
852+ p = mozpath .join (dest , raw_p ) if dest else raw_p
866853 yield p , f
867854
868855
@@ -873,22 +860,22 @@ def find_manifest_dirs(topsrcdir, manifests):
873860 """
874861 dirs = set ()
875862
876- for p in manifests :
877- p = os .path .join (topsrcdir , p )
863+ for manifest_path in manifests :
864+ abs_manifest_path = os .path .join (topsrcdir , manifest_path )
878865
879- if p .endswith (".ini" ) or p .endswith (".toml" ):
866+ if abs_manifest_path .endswith (".ini" ) or abs_manifest_path .endswith (".toml" ):
880867 test_manifest = TestManifest ()
881- test_manifest .read (p )
868+ test_manifest .read (abs_manifest_path )
882869 dirs |= set ([os .path .dirname (m ) for m in test_manifest .manifests ()])
883870
884- elif p .endswith (".list" ):
871+ elif abs_manifest_path .endswith (".list" ):
885872 m = ReftestManifest ()
886- m .load (p )
873+ m .load (abs_manifest_path )
887874 dirs |= m .dirs
888875
889876 else :
890877 raise Exception (
891- f'"{ os .path .splitext (p )[1 ]} " is not a supported manifest format.'
878+ f'"{ os .path .splitext (abs_manifest_path )[1 ]} " is not a supported manifest format.'
892879 )
893880
894881 dirs = {mozpath .normpath (d [len (topsrcdir ) :]).lstrip ("/" ) for d in dirs }
@@ -946,14 +933,13 @@ def main(argv):
946933 )
947934 file_count += 1
948935 else :
949- raise Exception ("unhandled file extension: %s" % out_file )
936+ raise Exception (f "unhandled file extension: { out_file } " )
950937
951938 duration = time .monotonic () - t_start
952939 zip_size = os .path .getsize (args .outputfile )
953940 basename = os .path .basename (args .outputfile )
954941 print (
955- "Wrote %d files in %d bytes to %s in %.2fs"
956- % (file_count , zip_size , basename , duration )
942+ f"Wrote { file_count } files in { zip_size } bytes to { basename } in { duration :.2f} s"
957943 )
958944
959945
0 commit comments