summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS.txt3
-rw-r--r--bs4/element.py5
2 files changed, 7 insertions, 1 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 31cfdbe..461f49d 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -14,6 +14,9 @@
object to search against a tag's CSS classes. Previously this only
worked if you passed in a string.
+* Fixed a bug that caused a crash when you passed a dictionary as an
+ attribute value (possibly because you mistyped "attrs"). [bug=842419]
+
= 4.0.0b4 (20120208) =
* Added BeautifulSoup.new_string() to go along with BeautifulSoup.new_tag()
diff --git a/bs4/element.py b/bs4/element.py
index ff7c972..c053181 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -1030,7 +1030,10 @@ class SoupStrainer(object):
and not isinstance(match_against, basestring)):
result = markup in match_against
elif hasattr(match_against, 'items'):
- result = match_against in markup
+ if markup is None:
+ result = len(match_against.items()) == 0
+ else:
+ result = match_against in markup
elif match_against and isinstance(markup, basestring):
match_against = markup.__class__(match_against)