[Zope-Checkins] CVS: ZODB/src/persistent - __init__.py:1.6.8.3

Jeremy Hylton jeremy at zope.com
Thu Feb 12 15:50:33 EST 2004


Update of /cvs-repository/ZODB/src/persistent
In directory cvs.zope.org:/tmp/cvs-serv22438

Modified Files:
      Tag: zope3-zodb3-devel-branch
	__init__.py 
Log Message:
Make sure persistent works even if the zope package isn't available.


=== ZODB/src/persistent/__init__.py 1.6.8.2 => 1.6.8.3 ===
--- ZODB/src/persistent/__init__.py:1.6.8.2	Fri Jan 16 16:17:10 2004
+++ ZODB/src/persistent/__init__.py	Thu Feb 12 15:50:32 2004
@@ -20,8 +20,12 @@
 import copy_reg
 copy_reg.constructor(simple_new)
 
-# Make an interface declaration for Persistent
-from zope.interface import classImplements
-from persistence.interfaces import IPersistent
-
-classImplements(Persistent, IPersistent)
+# Make an interface declaration for Persistent,
+# if zope.interface is available.
+try:
+    from zope.interface import classImplements
+except ImportError:
+    pass
+else:
+    from persistent.interfaces import IPersistent
+    classImplements(Persistent, IPersistent)




More information about the Zope-Checkins mailing list