diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-09 08:13:42 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-09 08:13:42 -0500 |
commit | ec3d55d62ddf86ba220b8acdafa5a33a74acaebb (patch) | |
tree | 10061183f5a42ae4b07b1893917d35ec53bc06a7 /bs4/element.py | |
parent | 600f332672763518033de253997a6e21fde07f44 (diff) |
Fixed a bug that caused a crash when you passed a dictionary as an attribute value (possibly because you mistyped attrs). [bug=842419]
Diffstat (limited to 'bs4/element.py')
-rw-r--r-- | bs4/element.py | 5 |
1 files changed, 4 insertions, 1 deletions
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) |