Skip to content

Commit

Permalink
More py f-string removals.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Jan 9, 2024
1 parent 6d60509 commit affa524
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions test/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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]*'):
Expand All @@ -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__':
Expand Down
8 changes: 4 additions & 4 deletions test/path_specials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions test/prebuilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")

Expand Down

0 comments on commit affa524

Please sign in to comment.