From eb8766b7ccb32f95d510fbfee08723bd2ea23f68 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Mon, 15 Aug 2022 07:31:05 +0200 Subject: [PATCH] f4pga/common_modules/fasm: use pathlib.rename instead of shutil.move Signed-off-by: Unai Martinez-Corral --- f4pga/common_modules/fasm.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/f4pga/common_modules/fasm.py b/f4pga/common_modules/fasm.py index 2dba668..06cd3ba 100644 --- a/f4pga/common_modules/fasm.py +++ b/f4pga/common_modules/fasm.py @@ -18,9 +18,8 @@ # SPDX-License-Identifier: Apache-2.0 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 @@ -58,11 +57,11 @@ class FasmModule(Module): else: 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' - if default_fasm_output_name != ctx.outputs.fasm: - sh_mv(default_fasm_output_name, ctx.outputs.fasm) + default_fasm_output_name = Path(build_dir)/ f'{ctx.values.top}.fasm' + if str(default_fasm_output_name) != ctx.outputs.fasm: + default_fasm_output_name.rename(ctx.outputs.fasm) if ctx.takes.fasm_extra: yield 'Appending extra FASM...'