diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-05-21 12:06:15 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-05-21 12:06:15 -0400 |
commit | 581e6d941036081ad7d09d51b3469eb8de891e09 (patch) | |
tree | 53809ee75691f3a54c211ec3b951615c506394ab /bs4 | |
parent | 60b789089df25026b48d0a63b054bfa1e347aac9 (diff) |
More Python 3 compatibility.
Diffstat (limited to 'bs4')
-rw-r--r-- | bs4/element.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bs4/element.py b/bs4/element.py index fb768d1..10377e9 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -822,10 +822,7 @@ class SoupStrainer(object): elif hasattr(matchAgainst, 'items'): result = matchAgainst in markup elif matchAgainst and isinstance(markup, basestring): - if isinstance(markup, unicode): - matchAgainst = unicode(matchAgainst) - else: - matchAgainst = str(matchAgainst) + matchAgainst = markup.__class__(matchAgainst) if not result: result = matchAgainst == markup |