[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/components.py In Zope 2.10 OFS.ObjectManager does not have a get method

Laurence Rowe l at lrowe.co.uk
Thu Sep 17 13:51:28 EDT 2009


Log message for revision 104254:
  In Zope 2.10 OFS.ObjectManager does not have a get method

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/components.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/components.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/components.py	2009-09-17 17:32:06 UTC (rev 104253)
+++ Products.GenericSetup/trunk/Products/GenericSetup/components.py	2009-09-17 17:51:28 UTC (rev 104254)
@@ -221,7 +221,10 @@
                 if ofs_id not in self.context.objectIds():
                     self.context._setObject(ofs_id, aq_base(obj),
                         set_owner=False, suppress_events=True)
-                obj = self.context.get(ofs_id)
+                try:
+                    obj = self.context.get(ofs_id)
+                except AttributeError:
+                    obj = self.context[ofs_id] # Zope 2.10
                 obj.__name__ = ofs_id
                 obj.__parent__ = aq_base(self.context)
                 self.context.registerUtility(aq_base(obj), provided, name)



More information about the checkins mailing list