From 58fabc972dd2bffc0f65d310b87f2f3f88b1bc83 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Mon, 9 Mar 2009 17:27:06 +0000 Subject: [PATCH] Fix expression evaluation order in __add__ method in html.py svn: r12273 --- src/plugins/webreport/html.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/webreport/html.py b/src/plugins/webreport/html.py index 283a8b4bf..3505b1340 100644 --- a/src/plugins/webreport/html.py +++ b/src/plugins/webreport/html.py @@ -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 #