Don't compare against booleans using ==.

This commit is contained in:
Lance Stout 2012-06-19 01:38:36 -07:00
parent 061489f03a
commit 8119551049
2 changed files with 3 additions and 3 deletions

View file

@ -93,7 +93,7 @@ class Set(ElementBase):
def set_before(self, val): def set_before(self, val):
b = self.xml.find("{%s}before" % (self.namespace)) b = self.xml.find("{%s}before" % (self.namespace))
if b is None and val == True: if b is None and val is True:
self._set_sub_text('{%s}before' % self.namespace, '', True) self._set_sub_text('{%s}before' % self.namespace, '', True)
else: else:
self._set_sub_text('{%s}before' % self.namespace, val) self._set_sub_text('{%s}before' % self.namespace, val)

View file

@ -88,7 +88,7 @@ class Catalog(ElementBase):
self._del_attr('restrict') self._del_attr('restrict')
if value: if value:
self._set_attr('restrict', 'true') self._set_attr('restrict', 'true')
elif value == False: elif value is False:
self._set_attr('restrict', 'false') self._set_attr('restrict', 'false')
@ -109,7 +109,7 @@ class CatalogItem(ElementBase):
self._del_attr('default') self._del_attr('default')
if value: if value:
self._set_attr('default', 'true') self._set_attr('default', 'true')
elif value == False: elif value is False:
self._set_attr('default', 'false') self._set_attr('default', 'false')