Skip to content

Commit da751da

Browse files
committed
resolve absolute path to nam file
1 parent c168510 commit da751da

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

hvcc/interpreters/pd2hv/PdParser.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,14 @@ def finalize_array(array: HeavyObject) -> None:
447447
elif Path(self.__HVLIB_DIR, f"{obj_type}.pd").is_file():
448448
self.obj_counter[obj_type] += 1
449449
hvlib_path = Path(self.__HVLIB_DIR, f"{obj_type}.pd")
450+
451+
# make sure that the nam file argument is an absolute path
452+
if obj_type == "pdnam~":
453+
path = Path(obj_args[0])
454+
if not path.is_absolute():
455+
path = pd_path.parent / path
456+
obj_args = [str(path)]
457+
450458
x = self.graph_from_file(
451459
file_path=hvlib_path,
452460
obj_args=obj_args,

0 commit comments

Comments
 (0)