Skip to content

Commit 243545b

Browse files
committed
Fixes 115 FragmentWrapper.isstring handles unicode
More info on <html5lib#115>
1 parent 70e432c commit 243545b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ Patches and suggestions
3232
- Juan Carlos Garcia Segovia
3333
- Mike West
3434
- Marc DM
35+
- Alexandre Leray

html5lib/treewalkers/lxmletree.py

Lines changed: 2 additions & 2 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 text_type, string_types, binary_type
33

44
from lxml import etree
55
from ..treebuilders.etree import tag_regexp
@@ -87,7 +87,7 @@ def __init__(self, fragment_root, obj):
8787
self.tail = ensure_str(self.obj.tail)
8888
else:
8989
self.tail = None
90-
self.isstring = isinstance(obj, str) or isinstance(obj, bytes)
90+
self.isstring = isinstance(obj, string_types) or isinstance(obj, binary_type)
9191
# Support for bytes here is Py2
9292
if self.isstring:
9393
self.obj = ensure_str(self.obj)

0 commit comments

Comments
 (0)