[z3-checkins] r5276 - z3/sqlos/trunk

dreamcatcher at codespeak.net dreamcatcher at codespeak.net
Thu Jun 24 20:54:28 MEST 2004


Author: dreamcatcher
Date: Thu Jun 24 20:54:27 2004
New Revision: 5276

Modified:
   z3/sqlos/trunk/_sqlos.py
   z3/sqlos/trunk/connection.py
Log:
Pass in a context to getUtility. Override __repr__ so we don't get into a deadlock while trying to compute it.

Modified: z3/sqlos/trunk/_sqlos.py
==============================================================================
--- z3/sqlos/trunk/_sqlos.py	(original)
+++ z3/sqlos/trunk/_sqlos.py	Thu Jun 24 20:54:27 2004
@@ -54,6 +54,9 @@
         return val
     get = classmethod(get)
 
+    def __repr__(self):
+        return '<%s at 0x%x>' % (self.__class__.__name__, id(self))
+
     def setConnection(cls, connection):
         if connection is not None:
             cls._connection = connection

Modified: z3/sqlos/trunk/connection.py
==============================================================================
--- z3/sqlos/trunk/connection.py	(original)
+++ z3/sqlos/trunk/connection.py	Thu Jun 24 20:54:27 2004
@@ -32,7 +32,7 @@
         name = self.name
         if name is None:
             try:
-                ut = zapi.getUtility(IConnectionName)
+                ut = zapi.getUtility(IConnectionName, context=context)
             except ComponentLookupError:
                 return self
             if ut is None:
@@ -41,7 +41,6 @@
                               SQLObjectWarning, 2)
                 return
             name = ut.name
-
         try:
             return getConnection(context, name)
         except ComponentLookupError:


More information about the z3-checkins mailing list