summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 23:22:13 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 23:22:13 -0500
commit7cb84c432367c52702920d68ec6c9669e9b6c9db (patch)
tree917850eedaed45168d419cf95cfe83a140fd3a00 /bs4/__init__.py
parent62d5de7f5ac4211b688665dd5912d4c4fd82e95c (diff)
Newly created tags use the same empty-element rules as the builder used to originally create the soup.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index af4563f..ea6dd25 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -169,10 +169,10 @@ class BeautifulSoup(Tag):
except StopParsing:
pass
- # Clear out the markup and the builder so they can be CGed.
+ # Clear out the markup and remove the builder's circular
+ # reference to this object.
self.markup = None
self.builder.soup = None
- self.builder = None
def _feed(self):
# Convert the document to Unicode.
@@ -195,7 +195,7 @@ class BeautifulSoup(Tag):
def new_tag(self, name, **attrs):
"""Create a new tag associated with this soup."""
- return Tag(None, None, name, attrs)
+ return Tag(None, self.builder, name, attrs)
def new_string(self, s):
"""Create a new NavigableString associated with this soup."""