f4pga/common_modules/fasm: use pathlib.rename instead of shutil.move

Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
Unai Martinez-Corral 2022-08-15 07:31:05 +02:00
parent 95b4857cd7
commit eb8766b7cc
1 changed files with 5 additions and 6 deletions

View File

@ -18,9 +18,8 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
from pathlib import Path from pathlib import Path
from shutil import move as sh_mv
from f4pga.common import vpr_specific_values, VprArgs, get_verbosity_level, sub from f4pga.common import vpr_specific_values, VprArgs, get_verbosity_level, sub as common_sub
from f4pga.module import Module, ModuleContext from f4pga.module import Module, ModuleContext
@ -58,11 +57,11 @@ class FasmModule(Module):
else: else:
yield 'Generating FASM...' yield 'Generating FASM...'
sub(*s, cwd=build_dir) common_sub(*s, cwd=build_dir)
default_fasm_output_name = f'{(Path(build_dir)/ctx.values.top)!s}.fasm' default_fasm_output_name = Path(build_dir)/ f'{ctx.values.top}.fasm'
if default_fasm_output_name != ctx.outputs.fasm: if str(default_fasm_output_name) != ctx.outputs.fasm:
sh_mv(default_fasm_output_name, ctx.outputs.fasm) default_fasm_output_name.rename(ctx.outputs.fasm)
if ctx.takes.fasm_extra: if ctx.takes.fasm_extra:
yield 'Appending extra FASM...' yield 'Appending extra FASM...'