Commit 2e965add authored by Barry Warsaw's avatar Barry Warsaw

__validate(): test for None-age, not not-ness

parent 35ae864a
......@@ -84,7 +84,7 @@ class TypeinWidget(Pmw.MegaWidget):
def __validate(self, text):
val = self.__str_to_int(text)
if val and val >= 0 and val < 256:
if (val is not None) and (val >= 0) and (val < 256):
return 1
else:
return -1
......@@ -96,7 +96,7 @@ class TypeinWidget(Pmw.MegaWidget):
rgbs = map(self.__str_to_int, vals)
valids = map(self.__validate, vals)
delegate = self['delegate']
if None not in rgbs and -1 not in valids and delegate:
if (None not in rgbs) and (-1 not in valids) and delegate:
delegate.set_color(self, rgbs)
# called whenever the color option is changed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment