summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-06 21:38:10 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-06 21:38:10 -0400
commit4a0f656752dc2de3f3451397e09e806ad2874ea1 (patch)
tree3dc037930ac080fd9c3ec50940e8803f0dcec128
parentc4ce22b415ab81ba0e3fb4a3fb28f4ce68dccbde (diff)
Stop a crash when unwisely messing with a tag that's been
decomposed. [bug=1097699]
-rw-r--r--NEWS.txt3
-rw-r--r--bs4/element.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS.txt b/NEWS.txt
index edbba28..781a514 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -17,6 +17,9 @@
* Fix a bug by which keyword arguments to find_parent() were not
being passed on. [bug=1126734]
+* Stop a crash when unwisely messing with a tag that's been
+ decomposed. [bug=1097699]
+
= 4.1.3 (20120820) =
* Skipped a test under Python 2.6 and Python 3.1 to avoid a spurious
diff --git a/bs4/element.py b/bs4/element.py
index d58da92..c081eba 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -915,6 +915,7 @@ class Tag(PageElement):
while i is not None:
next = i.next_element
i.__dict__.clear()
+ i.contents = []
i = next
def clear(self, decompose=False):