[autoreload] remove all modules under vregistry_path() from sys.modules before reloading
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Tue, 04 Aug 2009 18:43:55 +0200
changeset 2684 c84691380dd4
parent 2683 52b1a86c1913
child 2685 0518ca8f63e3
[autoreload] remove all modules under vregistry_path() from sys.modules before reloading
cwvreg.py
--- a/cwvreg.py	Tue Aug 04 18:40:47 2009 +0200
+++ b/cwvreg.py	Tue Aug 04 18:43:55 2009 +0200
@@ -10,6 +10,7 @@
 
 from logilab.common.decorators import cached, clear_cache, monkeypatch
 from logilab.common.deprecation import  deprecated
+from logilab.common.modutils import cleanup_sys_modules
 
 from rql import RQLHelper
 
@@ -306,6 +307,7 @@
         except RegistryOutOfDate:
             # modification detected, reset and reload
             self.reset()
+            cleanup_sys_modules(path)
             self._register_objects(path, force_reload)
 
     def _register_objects(self, path, force_reload=None):