[Zope3-checkins] CVS: Packages/ZConfig - Config.py:1.10

Fred L. Drake, Jr. fred@zope.com
Mon, 25 Nov 2002 17:52:47 -0500


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

Modified Files:
	Config.py 
Log Message:
Update the API slightly: when a named section has been requested and is not
available, raise a more reasonable exception.


=== Packages/ZConfig/Config.py 1.9 => 1.10 ===
--- Packages/ZConfig/Config.py:1.9	Fri Nov 22 13:13:32 2002
+++ Packages/ZConfig/Config.py	Mon Nov 25 17:52:16 2002
@@ -60,7 +60,11 @@
         # get section by name, relative to this section
         type = type.lower()
         if name:
-            return self._sections_by_name[(type, name.lower())]
+            key = (type, name.lower())
+            try:
+                return self._sections_by_name[key]
+            except KeyError:
+                raise ConfigurationMissingSectionError(type, name)
         else:
             L = []
             for sect in self._sections: