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

Jeremy Hylton jeremy@zope.com
Wed, 15 Jan 2003 15:06:03 -0500


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

Modified Files:
	module.py 
Log Message:
If something goes wrong creating a module, unregister it.


=== Zope3/src/zodb/code/module.py 1.6 => 1.7 ===
--- Zope3/src/zodb/code/module.py:1.6	Tue Dec 31 13:28:48 2002
+++ Zope3/src/zodb/code/module.py	Wed Jan 15 15:06:00 2003
@@ -132,7 +132,11 @@
             self._module = None
             raise
         self.name = name
-        self.update(source)
+        try:
+            self.update(source)
+        except:
+            self._registry.delModule(name)
+            raise
         if parent is not None:
             modname = name.split(".")[-1]
             setattr(parent, modname, self._module)