Refactor: More f-string for tools

This commit is contained in:
pagedown
2022-01-29 20:14:36 +08:00
parent 9f250fdf26
commit a22f37b919
7 changed files with 39 additions and 38 deletions

View File

@@ -710,7 +710,7 @@ def compile_c_extension(
def on_success() -> None:
os.rename(dest, real_dest)
compilation_database.add_command(desc, cmd, partial(newer, real_dest, *objects), on_success=on_success, key=CompileKey('', module + '.so'))
compilation_database.add_command(desc, cmd, partial(newer, real_dest, *objects), on_success=on_success, key=CompileKey('', f'{module}.so'))
def find_c_files() -> Tuple[List[str], List[str]]:
@@ -1112,7 +1112,7 @@ def create_macos_app_icon(where: str = 'Resources') -> None:
'iconutil', '-c', 'icns', iconset_dir, '-o', icns_dir
])
except FileNotFoundError:
print(error('iconutil not found') + ', using png2icns (without retina support) to convert the logo', file=sys.stderr)
print(f'{error("iconutil not found")}, using png2icns (without retina support) to convert the logo', file=sys.stderr)
subprocess.check_call([
'png2icns', icns_dir
] + [os.path.join(iconset_dir, logo) for logo in [