From 5768160d2d0b2379354f5ae16d843ac1fad939cd Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 18 Dec 2016 10:15:57 +0100 Subject: [PATCH] frontends(xmlui): better handling of missing _xmluiAppend --- frontends/src/tools/xmlui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontends/src/tools/xmlui.py b/frontends/src/tools/xmlui.py index 27dcffbe..b0213971 100644 --- a/frontends/src/tools/xmlui.py +++ b/frontends/src/tools/xmlui.py @@ -386,12 +386,14 @@ class XMLUIPanel(XMLUIBase): cont = self.widget_factory.createVerticalContainer(_xmlui_parent) self._parseChilds(cont, node, ('widget', 'container')) try: - _xmlui_parent._xmluiAppend(cont) + xmluiAppend = _xmlui_parent._xmluiAppend except (AttributeError, TypeError): # XXX: TypeError is here because pyjamas raise a TypeError instead of an AttributeError if _xmlui_parent is self: self.main_cont = cont else: raise Exception(_("Internal Error, container has not _xmluiAppend method")) + else: + xmluiAppend(cont) elif node.nodeName == 'tab': name = node.getAttribute('name')