summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
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."""