summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 13:37:26 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 13:37:26 -0500
commit4e502b398eddc677567538d5356a855137e155f7 (patch)
tree27ebb61bebc5e626a344830b6794b05c4f2c4278 /bs4/element.py
parentc87fccbf65cf50787eaa4cd57e4a9e1215a88ae5 (diff)
It's OK for a tag to contain another, identical tag, just not for it to contain itself.
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 211621e..8451d7c 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -109,7 +109,7 @@ class PageElement(object):
_lastRecursiveChild = _last_descendant
def insert(self, position, new_child):
- if new_child == self:
+ if new_child is self:
raise ValueError("Cannot insert a tag into itself.")
if (isinstance(new_child, basestring)
and not isinstance(new_child, NavigableString)):