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