11#!/usr/bin/env python
2- # emacs-mode: -*-python-*-
32
43"""
54test_pythonlib.py -- disassemble Python libraries
@@ -109,11 +108,11 @@ def get_srcdir():
109108 "3.12" ,
110109 "3.13" ,
111110):
112- bytecode = "bytecode_%s" % vers
113- key = "bytecode-%s" % vers
111+ bytecode = f "bytecode_{ vers } "
112+ key = f "bytecode-{ vers } "
114113 test_options [key ] = (os .path .join (src_dir , bytecode ), PYC , bytecode , vers )
115- key = "%s" % vers
116- pythonlib = "python%s" % vers
114+ key = vers
115+ pythonlib = f "python{ vers } "
117116 if isinstance (vers , float ) and vers >= 3.0 :
118117 pythonlib = os .path .join (src_dir , pythonlib , "__pycache__" )
119118 test_options [key ] = (os .path .join (lib_prefix , pythonlib ), PYOC , pythonlib , vers )
@@ -129,10 +128,10 @@ def get_srcdir():
129128 (312 , 3.12 ),
130129 (313 , 3.13 ),
131130):
132- bytecode = "bytecode_pypy%s" % vers
133- key = "bytecode-pypy%s" % vers
131+ bytecode = f "bytecode_pypy{ vers } "
132+ key = f "bytecode-pypy{ vers } "
134133 test_options [key ] = (os .path .join (src_dir , bytecode ), PYOC , bytecode , vers_dot )
135- key = "bytecode-pypy%s" % vers_dot
134+ key = f "bytecode-pypy{ vers_dot } "
136135 test_options [key ] = (os .path .join (src_dir , bytecode ), PYOC , bytecode , vers_dot )
137136
138137
@@ -246,7 +245,7 @@ def file_matches(files, root, basenames, patterns):
246245 checked_dirs = []
247246 start_with = None
248247
249- test_options_keys = list ( test_options .keys ())
248+ test_options_keys = [ str ( k ) for k in test_options .keys ()]
250249 test_options_keys .sort ()
251250 opts , args = getopt .getopt (
252251 sys .argv [1 :],
@@ -287,7 +286,7 @@ def file_matches(files, root, basenames, patterns):
287286 if os .path .isdir (src_dir ):
288287 checked_dirs .append ([src_dir , pattern , target_dir ])
289288 else :
290- sys .stderr .write ("Can't find directory %s . Skipping\n " % src_dir )
289+ sys .stderr .write (f "Can't find directory { src_dir } . Skipping\n " )
291290 continue
292291 last_compile_version = compiled_version
293292 pass
0 commit comments