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

Fred L. Drake, Jr. fred@zope.com
Thu, 12 Dec 2002 13:32:14 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	schema.py 
Log Message:
start_section():  Simplify; the type stack is always non-empty by the
                  time we get here now.


=== Packages/ZConfig/schema.py 1.1.2.8 => 1.1.2.9 ===
--- Packages/ZConfig/schema.py:1.1.2.8	Thu Dec 12 13:11:20 2002
+++ Packages/ZConfig/schema.py	Thu Dec 12 13:32:13 2002
@@ -163,13 +163,9 @@
         sectiontype = self._schema.gettype(type)
         maxOccurs, minOccurs, handler = self.get_common_info(attrs)
         any, name, attribute = self.get_name_info(attrs)
-        if self._stack:
-            parent = self._stack[-1]
-        else:
-            parent = self._schema
         section = info.SectionInfo(name, sectiontype, minOccurs, maxOccurs,
                                    handler, attribute)
-        parent.addsection(name, section)
+        self._stack[-1].addsection(name, section)
         self._stack.append(section)
 
     def end_section(self):