[Zope-CVS] CVS: Products/Ape/lib/apelib/zope2 - ofsserial.py:1.4

Shane Hathaway shane@zope.com
Thu, 10 Jul 2003 09:27:48 -0400


Update of /cvs-repository/Products/Ape/lib/apelib/zope2
In directory cvs.zope.org:/tmp/cvs-serv18259

Modified Files:
	ofsserial.py 
Log Message:
Deal properly with an empty string when converting a boolean property

=== Products/Ape/lib/apelib/zope2/ofsserial.py 1.3 => 1.4 ===
--- Products/Ape/lib/apelib/zope2/ofsserial.py:1.3	Wed Jul  9 11:40:15 2003
+++ Products/Ape/lib/apelib/zope2/ofsserial.py	Thu Jul 10 09:27:42 2003
@@ -248,7 +248,9 @@
             if t == 'lines':
                 data = v.split('\n')
             elif t == 'boolean':
-                if v == '0' or v[:1].lower() in 'fn': # match 0, [f]alse, [n]o
+                if (not v
+                    or v == '0'
+                    or v[:1].lower() in 'fn'): # match 0, [f]alse, [n]o
                     data = 0
                 else:
                     data = 1