diff options
-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 |