Skip to contentSkip to conversation

bs4: fix bitbake build error with latest html5lib version

PATCH New Enrico Jorns 1 participant 1 message Nov 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bs4: fix bitbake build error with latest html5lib version

Since the 0.999999999 release of python-html5lib, the module treewalkers._base was changed to treewalkers.base (without underscore). This breaks bitbake is it uses the old module name.

|   [...]
|   File "[...]/bitbake/lib/bs4/builder/_html5lib.py", line 57, in <module>
|       class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
| AttributeError: 'module' object has no attribute '_base'
| [...]/bitbake/lib/bb/event.py:119: RuntimeWarning: Parent module 'bb' not found while handling absolute import

This patch renames all occurrences of the _base module to base.

Note that this patch will break builds with older versions of python-html5lib.

---
 bitbake/lib/bs4/builder/_html5lib.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/bs4/builder/_html5lib.py +2 -2
index 7de36ae..529ce5a 100644
@@ -54,7 +54,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder):
         return u'<html><head></head><body>%s</body></html>' % fragment
 
 
-class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
+class TreeBuilderForHtml5lib(html5lib.treebuilders.base.TreeBuilder):
 
     def __init__(self, soup, namespaceHTMLElements):
         self.soup = soup
@@ -115,7 +115,7 @@ class AttrList(object):
         return name in list(self.attrs.keys())
 
 
-class Element(html5lib.treebuilders._base.Node):
+class Element(html5lib.treebuilders.base.Node):
     def __init__(self, element, soup, namespace):
         html5lib.treebuilders._base.Node.__init__(self, element.name)
         self.element = element
Signature · 1 line
2.10.2