From d682510c42b4f9794fa84d3a5b0dba3164ae0a70 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 19 Dec 2012 09:42:52 +0000 Subject: [PATCH] 6227: libhtml handles strings differently in python2.x and python3.x svn: r20796 --- gramps/plugins/lib/libhtml.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gramps/plugins/lib/libhtml.py b/gramps/plugins/lib/libhtml.py index 0f613fdf8..9690a55fe 100644 --- a/gramps/plugins/lib/libhtml.py +++ b/gramps/plugins/lib/libhtml.py @@ -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 #