From 70a51ed8ef1b0e00b5429d8cb6db930a91d07e4b Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 3 Jun 2024 16:26:12 -0700 Subject: [PATCH] path_into should use destination port's ptype by default --- masque/builder/pather.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/masque/builder/pather.py b/masque/builder/pather.py index 11e4d80..606c819 100644 --- a/masque/builder/pather.py +++ b/masque/builder/pather.py @@ -437,7 +437,7 @@ class Pather(Builder): portspec_dst: str, *, tool_port_names: tuple[str, str] = ('A', 'B'), - out_ptype: str = 'unk', + out_ptype: str | None = None, plug_destination: bool = True, **kwargs, ) -> Self: @@ -448,6 +448,9 @@ class Pather(Builder): port_src = self.pattern[portspec_src] port_dst = self.pattern[portspec_dst] + if out_ptype is None: + out_ptype = port_dst.ptype + if port_src.rotation is None: raise PortError(f'Port {portspec_src} has no rotation and cannot be used for path_into()') if port_dst.rotation is None: