diff -r d5df428640ff -r ccf59c1f0b45 editors/LDViewer.py --- a/editors/LDViewer.py Thu Aug 17 15:43:25 2017 +0300 +++ b/editors/LDViewer.py Thu Aug 17 16:26:32 2017 +0300 @@ -215,7 +215,10 @@ if rung not in rungs: rungs.append(rung) if len(rungs) > 1: - raise ValueError, _("Ladder element with id %d is on more than one rung.") % instance["id"] + raise ValueError( + _("Ladder element with id %d is on more than one rung.") + % instance["id"]) + element = self.FindElementById(instance["id"]) element_connectors = element.GetConnectors() self.Rungs[rungs[0]].SelectElement(element) @@ -231,7 +234,10 @@ if rung not in rungs: rungs.append(rung) if len(rungs) > 1: - raise ValueError, _("Ladder element with id %d is on more than one rung.") % instance["id"] + raise ValueError( + _("Ladder element with id %d is on more than one rung.") + % instance["id"]) + element = self.FindElementById(instance["id"]) element_connectors = element.GetConnectors() self.Rungs[rungs[0]].SelectElement(element)