[Zope3-checkins] CVS: Packages/ZConfig - schema.py:1.1.2.30

Fred L. Drake, Jr. fred@zope.com
Fri, 20 Dec 2002 17:33:57 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	schema.py 
Log Message:
For <key> elements, "finish" the KeyInfo object as soon as the default
value has been added, so that nested <default> elements will be
rejected; those are only allowed for <multikey> elements.


=== Packages/ZConfig/schema.py 1.1.2.29 => 1.1.2.30 ===
--- Packages/ZConfig/schema.py:1.1.2.29	Thu Dec 19 11:51:27 2002
+++ Packages/ZConfig/schema.py	Fri Dec 20 17:33:56 2002
@@ -268,11 +268,12 @@
             if min:
                 self.error("required key cannot have a default value")
             key.adddefault(str(attrs["default"]).strip())
+        key.finish()
         self._stack[-1].addkey(key)
         self._stack.append(key)
 
     def end_key(self):
-        self._stack.pop().finish()
+        self._stack.pop()
 
     def start_multikey(self, attrs):
         if attrs.has_key("default"):