summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-05-21 11:15:56 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2011-05-21 11:15:56 -0400
commit550eebcc806a161cbf5e5ac7eb441cdf987a995b (patch)
tree59b0c7e7dd36f9aa0afd2e632778620ff3aa82ce /bs4/element.py
parentb01f9312a13198d249060dac34ab12629285cdb2 (diff)
parent640fdc0fa7f2ffd53fb92dbeac8b456bb09dcaa7 (diff)
Merged in the removal of util.py.
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 6fb6210..587078c 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -6,8 +6,6 @@ except ImportError:
name2codepoint = {}
from bs4.dammit import EntitySubstitution
-from util import isList
-
DEFAULT_OUTPUT_ENCODING = "utf-8"
@@ -771,7 +769,7 @@ class SoupStrainer(object):
found = None
# If given a list of items, scan it for a text element that
# matches.
- if isList(markup) and not isinstance(markup, Tag):
+ if hasattr(markup, '__iter__') and not isinstance(markup, Tag):
for element in markup:
if isinstance(element, NavigableString) \
and self.search(element):
@@ -810,7 +808,7 @@ class SoupStrainer(object):
if hasattr(matchAgainst, 'match'):
# It's a regexp object.
result = markup and matchAgainst.search(markup)
- elif (isList(matchAgainst)
+ elif (hasattr(matchAgainst, '__iter__')
and (markup is not None
or not isinstance(matchAgainst, basestring))):
result = markup in matchAgainst