[Checkins] SVN: GenericSetup/trunk/components.py Handle invalid utility definitions more gracefully. This is part of http://www.zope.org/Collectors/CMF/473

Wichert Akkerman wichert at wiggy.net
Fri Jul 6 10:17:30 EDT 2007


Log message for revision 77511:
  Handle invalid utility definitions more gracefully. This is part of http://www.zope.org/Collectors/CMF/473

Changed:
  U   GenericSetup/trunk/components.py

-=-
Modified: GenericSetup/trunk/components.py
===================================================================
--- GenericSetup/trunk/components.py	2007-07-06 14:11:31 UTC (rev 77510)
+++ GenericSetup/trunk/components.py	2007-07-06 14:17:29 UTC (rev 77511)
@@ -146,8 +146,11 @@
                                          "supported right now." % obj_path)
             elif component:
                 self.context.registerUtility(component, provided, name)
+            elif factory is not None:
+                self.context.registerUtility(factory(), provided, name)
             else:
-                self.context.registerUtility(factory(), provided, name)
+                self._logger.error("Invalid utility registration for "
+                                   "interface %s" % provided)
 
     def _extractAdapters(self):
         fragment = self._doc.createDocumentFragment()



More information about the Checkins mailing list