Fix invalid escape sequences

In Python 3.12, these show up as SyntaxWarning messages.
This commit is contained in:
Tynan McAuley
2024-02-23 15:30:15 -08:00
parent 8da6c5a8c2
commit b260078ae4

View File

@@ -110,7 +110,7 @@ def generate_copy(c, sfx):
new_file = os.path.join(args.gcpath, new_file) new_file = os.path.join(args.gcpath, new_file)
shutil.copy(cur_file, new_file) shutil.copy(cur_file, new_file)
bash(f"{SED} -i 's/module\( \+\){cur_name}/module\\1{new_name}/' {new_file}") bash(rf"{SED} -i 's/module\( \+\){cur_name}/module\1{new_name}/' {new_file}")
return new_file return new_file
def bfs_uniquify_modules(tree, common_fnames, verilog_module_filename): def bfs_uniquify_modules(tree, common_fnames, verilog_module_filename):
@@ -137,7 +137,7 @@ def bfs_uniquify_modules(tree, common_fnames, verilog_module_filename):
new_file = generate_copy(cur_file, MODEL_SFX) new_file = generate_copy(cur_file, MODEL_SFX)
if parent is not None and ((parent, mod) not in updated_submodule): if parent is not None and ((parent, mod) not in updated_submodule):
parent_file = os.path.join(args.gcpath, verilog_module_filename[parent]) parent_file = os.path.join(args.gcpath, verilog_module_filename[parent])
bash(f"{SED} -i 's/\( \*\){mod}\( \+\)/\\1{mod}_{MODEL_SFX}\\2/' {parent_file}") bash(rf"{SED} -i 's/\( \*\){mod}\( \+\)/\1{mod}_{MODEL_SFX}\2/' {parent_file}")
updated_submodule.add((parent, mod)) updated_submodule.add((parent, mod))
# add the uniquified module to the verilog_modul_filename dict # add the uniquified module to the verilog_modul_filename dict