summaryrefslogtreecommitdiff
path: root/beautifulsoup/__init__.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-02-20 15:08:51 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-02-20 15:08:51 -0500
commit89961f4de3ab1e88b15dd9c0aaa0af77a7c32262 (patch)
tree76d78c8831f0acb5a3a41bc628ffbd62b0bbfc6d /beautifulsoup/__init__.py
parent6de230d1f201c686d56e5f5a5241db69c316cea8 (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__.py7
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()