[Zodb-checkins] CVS: Packages/ZConfig - matcher.py:1.1.2.29

Chris McDonough chrism@zope.com
Wed, 1 Jan 2003 04:17:56 -0500


Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv12805

Modified Files:
      Tag: zconfig-schema-devel-branch
	matcher.py 
Log Message:
Don't raise an attribute error on __type__ if an unrequired and config-missing section defaults to None.


=== Packages/ZConfig/matcher.py 1.1.2.28 => 1.1.2.29 ===
--- Packages/ZConfig/matcher.py:1.1.2.28	Tue Dec 31 17:06:12 2002
+++ Packages/ZConfig/matcher.py	Wed Jan  1 04:17:54 2003
@@ -155,7 +155,12 @@
             name, ci = self.type[i]
             if ci.ismulti():
                 if ci.issection():
-                    v = [s.__type__.datatype(s) for s in values[i]]
+                    v = []
+                    for s in values[i]:
+                        if s is not None:
+                            v.append(s.__type__.datatype(s))
+                        else:
+                            v.append(None)
                 elif ci.name == '+':
                     v = values[i]
                     for key, val in v.items():
@@ -163,7 +168,10 @@
                 else:
                     v = [ci.datatype(s) for s in values[i]]
             elif ci.issection():
-                v = values[i].__type__.datatype(values[i])
+                if values[i] is not None:
+                    v = values[i].__type__.datatype(values[i])
+                else:
+                    v = None
             elif name == '+':
                 v = values[i]
                 for key, val in v.items():