diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 15:08:51 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 15:08:51 -0500 |
commit | 89961f4de3ab1e88b15dd9c0aaa0af77a7c32262 (patch) | |
tree | 76d78c8831f0acb5a3a41bc628ffbd62b0bbfc6d /beautifulsoup/__init__.py | |
parent | 6de230d1f201c686d56e5f5a5241db69c316cea8 (diff) |
Discovered that html5lib can't be made to support SoupStrainers, and changed the test suite appropriately.
Diffstat (limited to 'beautifulsoup/__init__.py')
-rw-r--r-- | beautifulsoup/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/beautifulsoup/__init__.py b/beautifulsoup/__init__.py index ca32589..968be08 100644 --- a/beautifulsoup/__init__.py +++ b/beautifulsoup/__init__.py @@ -121,10 +121,10 @@ class BeautifulSoup(Tag): @classmethod def default_builder(self): try: - from builder.html5_builder import HTML5TreeBuilder + from builder import HTML5TreeBuilder return HTML5TreeBuilder() except ImportError: - from builder.lxml_builder import LXMLTreeBuilder + from builder import LXMLTreeBuilder return LXMLTreeBuilder() def __init__(self, markup="", builder=None, parseOnlyThese=None, @@ -258,12 +258,15 @@ class BeautifulSoup(Tag): tag = Tag(self, self.builder, name, attrs, self.currentTag, self.previous) + if tag is None: + return tag if self.previous: self.previous.next = tag self.previous = tag self.pushTag(tag) return tag + def handle_endtag(self, name): #print "End tag: " + name self.endData() |