Fix expression evaluation order in __add__ method in html.py
svn: r12273
This commit is contained in:
@@ -62,9 +62,9 @@ class Html(list):
|
|||||||
self += [tag]
|
self += [tag]
|
||||||
self.end = None
|
self.end = None
|
||||||
else:
|
else:
|
||||||
if tag in ['area','base','br','frame','hr',
|
if tag in ['area', 'base', 'br', 'frame', 'hr',
|
||||||
'img','input','link','meta','param']:
|
'img', 'input', 'link', 'meta', 'param']:
|
||||||
close = False
|
self.end = close = False
|
||||||
begin = '<%s%s%s>' % (
|
begin = '<%s%s%s>' % (
|
||||||
tag,
|
tag,
|
||||||
attr,
|
attr,
|
||||||
@@ -76,7 +76,7 @@ class Html(list):
|
|||||||
def __add__(self, value):
|
def __add__(self, value):
|
||||||
if isinstance(value, Html) or not hasattr(value, '__iter__'):
|
if isinstance(value, Html) or not hasattr(value, '__iter__'):
|
||||||
value = [value]
|
value = [value]
|
||||||
index = len(self) - 1 if self.end else 0
|
index = len(self) - (1 if self.end else 0)
|
||||||
self[index:index] = value
|
self[index:index] = value
|
||||||
return self
|
return self
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user