From affa524b497b65af74b5f2e65765c5dee9cc1d82 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 9 Jan 2024 10:32:03 -0600 Subject: [PATCH] More py f-string removals. --- test/docs.py | 8 ++++---- test/path_specials.py | 8 ++++---- test/prebuilt.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/docs.py b/test/docs.py index ccbfdf47ad..dbce3b0792 100644 --- a/test/docs.py +++ b/test/docs.py @@ -18,7 +18,7 @@ def read_text(path, root): data = path.read_bytes() i = data.rfind(b'\n', 0, e.start) + 1 j = data.find(b'\n', e.end) - e.reason += f'\nOn line: {data[i:j]}\nIn file {path.relative_to(root)}' + e.reason += '\nOn line: {}\nIn file {}'.format(data[i:j],path.relative_to(root)) raise @@ -41,7 +41,7 @@ def main(): if '-v' in sys.argv: for incl, tags in sorted(already_included.items()): - print(f'* {incl}: {tags}') + print('* {}: {}'.format(incl,tags)) fail = False #for path in (root / 'src').rglob('*.[jch]*'): @@ -56,13 +56,13 @@ def main(): path = path.relative_to(root).as_posix() already_included_tags = already_included.get(str(path)) if already_included_tags is None: - print(f'{path} has documentation but is not included anywhere, uses tags: {", ".join(tags)}') + print('{} has documentation but is not included anywhere, uses tags: {}'.format(path,", ".join(tags))) fail = True continue tags -= already_included_tags if tags: - print(f'{path} has unused in documentation tags: {", ".join(tags)}') + print('{} has unused in documentation tags: {}'.format(path,", ".join(tags))) fail = True if not fail and __name__ == '__main__': diff --git a/test/path_specials.py b/test/path_specials.py index b317790d5a..525812d437 100644 --- a/test/path_specials.py +++ b/test/path_specials.py @@ -31,7 +31,7 @@ def test_dir(dir_name): if os.environ.get('MSYSTEM') in ['UCRT64', 'MINGW64', 'MINGW32'] and t.toolset in ['gcc', 'clang']: do_compile_test = False - t.write(f'{dir_name}/jamroot.jam', '''\ + t.write('{}/jamroot.jam'.format(dir_name), '''\ import testing ; actions write-file { @@ -41,13 +41,13 @@ def test_dir(dir_name): ''' + ('''\ unit-test test : test.cpp ; ''' if do_compile_test else '')) - t.write(f'{dir_name}/test.cpp', 'int main() {}\n') + t.write('{}/test.cpp'.format(dir_name), 'int main() {}\n') with patch.dict(os.environ, tmp): t.run_build_system([dir_name]) - t.expect_addition(f'{dir_name}/bin/test.txt') + t.expect_addition('{}/bin/test.txt'.format(dir_name)) if do_compile_test: - t.expect_addition(f'{dir_name}/bin/$toolset/debug*/test.passed') + t.expect_addition('{}/bin/$toolset/debug*/test.passed'.format(dir_name)) test_dir('has space') diff --git a/test/prebuilt.py b/test/prebuilt.py index 3e4d1b0e8a..94b851d7bd 100644 --- a/test/prebuilt.py +++ b/test/prebuilt.py @@ -22,7 +22,7 @@ # can only use compiled binaries. t.copy("ext/jamfile2.jam", "ext/jamfile.jam") -libname = t.adjust_name("a.implib" if t.is_implib_expected() else "a.dll") +libname = t.adjust_name("a.implib" if t.is_implib_expected() else "a.dll") # Now check that we can build the main project, and that correct prebuilt file # is picked, depending of variant. This also checks that correct includes for @@ -36,7 +36,7 @@ # Now test that prebuilt file specified by absolute name works too. t.copy("ext/jamfile3.jam", "ext/jamfile.jam") -t.run_build_system([f"-sLIBNAME={libname}"]) +t.run_build_system(["-sLIBNAME={}".format(libname)]) t.expect_addition("bin/$toolset/debug*/hello.exe") t.expect_addition("bin/$toolset/release*/hello.exe")