6227: libhtml handles strings differently in python2.x and python3.x
svn: r20796
This commit is contained in:
@@ -332,8 +332,8 @@ class Html(list):
|
|||||||
:rtype: object reference
|
:rtype: object reference
|
||||||
:returns: reference to object with new value added
|
:returns: reference to object with new value added
|
||||||
"""
|
"""
|
||||||
if isinstance(value, Html) or (not hasattr(value, '__iter__') and
|
if (isinstance(value, Html) or not hasattr(value, '__iter__') or
|
||||||
not isinstance(value, STRTYPE)):
|
isinstance(value, STRTYPE)):
|
||||||
value = [value]
|
value = [value]
|
||||||
index = len(self) - (1 if self.close else 0)
|
index = len(self) - (1 if self.close else 0)
|
||||||
self[index:index] = value
|
self[index:index] = value
|
||||||
@@ -556,8 +556,8 @@ class Html(list):
|
|||||||
"""
|
"""
|
||||||
if len(self) < 2:
|
if len(self) < 2:
|
||||||
raise AttributeError('No closing tag. Cannot set inside value')
|
raise AttributeError('No closing tag. Cannot set inside value')
|
||||||
if isinstance(value, Html) or (not hasattr(value, '__iter__') and
|
if (isinstance(value, Html) or not hasattr(value, '__iter__') or
|
||||||
not isinstance(value, STRTYPE)):
|
isinstance(value, STRTYPE)):
|
||||||
value = [value]
|
value = [value]
|
||||||
self[1:-1] = value
|
self[1:-1] = value
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user