summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-02-13 21:29:13 (GMT)
committerBarry Warsaw <barry@python.org>1998-02-13 21:29:13 (GMT)
commit2e965add309265beed1a946fff12674a8b86d764 (patch)
tree2e624debc04e92e30732600bc133f9bf803dccee /Tools
parent35ae864ab779beef364917671365558cc36629a6 (diff)
downloadcpython-2e965add309265beed1a946fff12674a8b86d764.zip
cpython-2e965add309265beed1a946fff12674a8b86d764.tar.gz
cpython-2e965add309265beed1a946fff12674a8b86d764.tar.bz2
__validate(): test for None-age, not not-ness
Diffstat (limited to 'Tools')
-rw-r--r--Tools/pynche/TypeinViewer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/pynche/TypeinViewer.py b/Tools/pynche/TypeinViewer.py
index aabcd73..d25eb82 100644
--- a/Tools/pynche/TypeinViewer.py
+++ b/Tools/pynche/TypeinViewer.py
@@ -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