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
#