[PortList] plugged() failure shouldn't dirty the ports
This commit is contained in:
parent
35b42c397b
commit
395ad4df9d
2 changed files with 26 additions and 1 deletions
|
|
@ -413,6 +413,10 @@ class PortList(metaclass=ABCMeta):
|
|||
if missing_b:
|
||||
raise PortError(f'Connection destination ports were not found: {missing_b}')
|
||||
a_names, b_names = list(zip(*connections.items(), strict=True))
|
||||
used_names = list(chain(a_names, b_names))
|
||||
duplicate_names = {name for name in used_names if used_names.count(name) > 1}
|
||||
if duplicate_names:
|
||||
raise PortError(f'Each port may appear in at most one connection: {duplicate_names}')
|
||||
a_ports = [self.ports[pp] for pp in a_names]
|
||||
b_ports = [self.ports[pp] for pp in b_names]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue