[Checkins] SVN: Products.SQLAlchemyDA/trunk/da.py also added preliminary unregistration code for Zope 2.9

Andreas Jung andreas at andreas-jung.com
Sat Jun 9 06:45:05 EDT 2007


Log message for revision 76537:
  also added preliminary unregistration code for Zope 2.9
  

Changed:
  U   Products.SQLAlchemyDA/trunk/da.py

-=-
Modified: Products.SQLAlchemyDA/trunk/da.py
===================================================================
--- Products.SQLAlchemyDA/trunk/da.py	2007-06-09 10:37:57 UTC (rev 76536)
+++ Products.SQLAlchemyDA/trunk/da.py	2007-06-09 10:45:05 UTC (rev 76537)
@@ -281,12 +281,16 @@
             unregisterUtility(name=self.util_id)
             self._new_utilid()
         except ImportError:
-            # zope 2.8
-            from zope.component.servicenames import Utilities
-            from zope.app import zapi
-            s = zapi.getGlobalServices().getService(Utilities)
-            s.register((), ISQLAlchemyWrapper, self.util_id, None)
-            self._new_utilid()
+            try:
+                # zope 2.8
+                from zope.component.servicenames import Utilities
+                from zope.app import zapi
+                s = zapi.getGlobalServices().getService(Utilities)
+                s.register((), ISQLAlchemyWrapper, self.util_id, None)
+                self._new_utilid()
+            except:
+                # Zope 2.9 ATT: fix this
+                self._new_utilid()
             
         return super(SAWrapper, self).manage_editProperties(REQUEST)
 



More information about the Checkins mailing list