[Zope-CVS] CVS: Products/AdaptableStorage/zodb - ASConnection.py:1.17
Shane Hathaway
shane@zope.com
Wed, 5 Feb 2003 11:51:30 -0500
Update of /cvs-repository/Products/AdaptableStorage/zodb
In directory cvs.zope.org:/tmp/cvs-serv28095/zodb
Modified Files:
ASConnection.py
Log Message:
Cleaned up the import statements, fixed a NameError on
'InvalidObjectReference', and made invalid object references produce more
information.
=== Products/AdaptableStorage/zodb/ASConnection.py 1.16 => 1.17 ===
--- Products/AdaptableStorage/zodb/ASConnection.py:1.16 Tue Jan 14 12:46:46 2003
+++ Products/AdaptableStorage/zodb/ASConnection.py Wed Feb 5 11:51:27 2003
@@ -19,11 +19,15 @@
import sys
from time import time
from types import StringType, TupleType
+from cStringIO import StringIO
+from cPickle import Unpickler, Pickler
-from ZODB import Persistent
-from ZODB.Connection import Connection, StringIO, Unpickler, Pickler, \
- ConflictError, ReadConflictError, LOG, ERROR
from Acquisition import aq_base
+from ZODB import Persistent
+from ZODB.POSException \
+ import ConflictError, ReadConflictError, InvalidObjectReference
+from ZODB.Connection import Connection
+from zLOG import LOG, ERROR
from consts import SERIAL0, DEBUG
from mapper_public import IKeyedObjectSystem, SerializationEvent, \
@@ -248,7 +252,12 @@
ext_oid = oid_encoder.encode(ext_keychain)
if ext_ref._p_jar:
if ext_ref._p_jar != self:
- raise InvalidObjectReference
+ print object.__dict__
+ print ext_ref.__dict__
+ raise InvalidObjectReference, (
+ "Can't refer from %s in %s to %s in %s"
+ % (repr(object), repr(self), repr(ext_ref),
+ repr(ext_ref._p_jar)))
else:
ext_ref._p_jar = self
if ext_ref._p_oid: