6227: libhtml handles strings differently in python2.x and python3.x

svn: r20796
This commit is contained in:
Benny Malengier 2012-12-19 09:42:52 +00:00
parent 55d9ef2dbf
commit d682510c42

View File

@ -332,8 +332,8 @@ class Html(list):
:rtype: object reference
:returns: reference to object with new value added
"""
if isinstance(value, Html) or (not hasattr(value, '__iter__') and
not isinstance(value, STRTYPE)):
if (isinstance(value, Html) or not hasattr(value, '__iter__') or
isinstance(value, STRTYPE)):
value = [value]
index = len(self) - (1 if self.close else 0)
self[index:index] = value
@ -556,8 +556,8 @@ class Html(list):
"""
if len(self) < 2:
raise AttributeError('No closing tag. Cannot set inside value')
if isinstance(value, Html) or (not hasattr(value, '__iter__') and
not isinstance(value, STRTYPE)):
if (isinstance(value, Html) or not hasattr(value, '__iter__') or
isinstance(value, STRTYPE)):
value = [value]
self[1:-1] = value
#