Skip to content

Commit a106d6c

Browse files
committed
Fix HTMLSerializer on Py2 shouldn't assert unicode strings.
1 parent 92ed92a commit a106d6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

html5lib/serializer/htmlserializer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import absolute_import, division, unicode_literals
2-
from six import text_type
2+
from six import string_types
33

44
try:
55
from functools import reduce
@@ -155,14 +155,14 @@ def __init__(self, **kwargs):
155155
self.strict = False
156156

157157
def encode(self, string):
158-
assert(isinstance(string, text_type))
158+
assert(isinstance(string, string_types))
159159
if self.encoding:
160160
return string.encode(self.encoding, unicode_encode_errors)
161161
else:
162162
return string
163163

164164
def encodeStrict(self, string):
165-
assert(isinstance(string, text_type))
165+
assert(isinstance(string, string_types))
166166
if self.encoding:
167167
return string.encode(self.encoding, "strict")
168168
else:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy