[Zope-CVS] CVS: Products/Ape/lib/apelib/core - io.py:1.9

Shane Hathaway shane at zope.com
Wed Mar 17 19:17:01 EST 2004


Update of /cvs-repository/Products/Ape/lib/apelib/core
In directory cvs.zope.org:/tmp/cvs-serv26477

Modified Files:
	io.py 
Log Message:
Ignore LoadErrors in getPollSources().

Some back-ends, filesystem storage in particular, don't store OIDs that
never get linked to a parent object.


=== Products/Ape/lib/apelib/core/io.py 1.8 => 1.9 ===
--- Products/Ape/lib/apelib/core/io.py:1.8	Tue Feb 17 00:25:11 2004
+++ Products/Ape/lib/apelib/core/io.py	Wed Mar 17 19:17:00 2004
@@ -20,10 +20,10 @@
 
 from weakref import proxy
 
-from events \
-     import DatabaseInitEvent, GatewayEvent, LoadEvent, StoreEvent, \
-     SerializationEvent, DeserializationEvent
+from events import DatabaseInitEvent, GatewayEvent, LoadEvent, StoreEvent
+from events import SerializationEvent, DeserializationEvent
 from interfaces import IMapperConfiguration, ITPCConnection, IObjectDatabase
+from interfaces import LoadError
 
 
 class GatewayIO:
@@ -110,7 +110,11 @@
         return event, new_hash
 
     def getPollSources(self, oid):
-        classification = self.classifyState(oid)
+        try:
+            classification = self.classifyState(oid)
+        except LoadError:
+            # Doesn't exist.
+            return {}
         mapper_name = classification['mapper_name']
         mapper = self.conf.mappers[mapper_name]
         event = LoadEvent(self.conf, mapper, oid, self.conn_map, classification)




More information about the Zope-CVS mailing list