Skip to content

Commit 9c1bf17

Browse files
committed
fix: regression
Fix regression introduced where string operations were being attempted on Path object. Replace the operation with an equivalent Pathlib operation and then cast back to a string as otherwise the wildcard substitution fails. This kind of regression highlights the need for integration tests that check a representative config can be loaded correctly. Right now it's quite difficult to refactor without introducing bugs like this with seemingly innocuous changes. Signed-off-by: James McCorrie <james.mccorrie@lowrisc.org>
1 parent fc763d4 commit 9c1bf17

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/dvsim/flow/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None:
132132
self._load_child_cfg(entry, mk_config)
133133

134134
if self.rel_path == "":
135-
self.rel_path = Path(self.flow_cfg_file).parent.replace(self.proj_root + "/", "")
135+
self.rel_path = str(
136+
Path(self.flow_cfg_file).parent.relative_to(self.proj_root),
137+
)
136138

137139
# Process overrides before substituting wildcards
138140
self._process_overrides()

0 commit comments

Comments
 (0)