From ef3e3252e77e3e329d89bdac90b8ae88e428982f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 7 Dec 2011 00:37:56 +0200 Subject: [PATCH] Comparison to None is discouraged --- openlp/core/utils/actions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 26a0c48e8..37c2676ac 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -149,7 +149,7 @@ class CategoryList(object): return self.__next__() def has_key(self, key): - if key != None and not isinstance(key, unicode): + if key and not isinstance(key, unicode): key = unicode(key) for category in self.categories: if category.name == key: @@ -166,7 +166,7 @@ class CategoryList(object): self.add(name, weight) def add(self, name, weight=0, actions=None): - if name != None and not isinstance(name, unicode): + if name and not isinstance(name, unicode): name = unicode(name) category = ActionCategory(name, weight) if actions: @@ -274,7 +274,7 @@ class ActionList(object): ``weight`` The category's weight (int). """ - if name != None and not isinstance(name, unicode): + if name and not isinstance(name, unicode): name = unicode(name) if name in self.categories: # Only change the weight and resort the categories again.