[Zodb-checkins] CVS: Zope3/src/zodb/code - module.py:1.4

Jeremy Hylton jeremy@zope.com
Mon, 30 Dec 2002 14:19:38 -0500


Update of /cvs-repository/Zope3/src/zodb/code
In directory cvs.zope.org:/tmp/cvs-serv1647

Modified Files:
	module.py 
Log Message:
Add comment about why modules aren't stored in sys.modules.


=== Zope3/src/zodb/code/module.py 1.3 => 1.4 ===
--- Zope3/src/zodb/code/module.py:1.3	Mon Dec 30 14:14:36 2002
+++ Zope3/src/zodb/code/module.py	Mon Dec 30 14:19:37 2002
@@ -224,6 +224,13 @@
     a way to deal with this.
     """
 
+    # The import hook doesn't use sys.modules, because Zope might want
+    # to have placeful registries.  That is, a particular module might
+    # execute in a context where there is more than one persistent
+    # module registry active.  In this case, it isn't safe to use
+    # sys.modules, because each registry could have a different binding
+    # for a particular name.
+
     def __init__(self):
         self._saved_import = None