Commits

Anonymous committed 1ceacb2

[gsoc2009-testing] RollbackImporter has proven to be a poor match for djangos loading system, removing

  • Participants
  • Parent commits 6c82ae8
  • Branches soc2009/test-improvements

Comments (0)

Files changed (1)

File django/test/rollback_importer.py

-class RollbackImporter:
-    def __init__(self):
-        "Creates an instance and installs as the global importer"
-        self.previousModules = sys.modules.copy()
-        self.realImport = __builtin__.__import__
-        __builtin__.__import__ = self._import
-        self.newModules = {}
-
-    def _import(self, name, globals=None, locals=None, fromlist=[]):
-        result = apply(self.realImport, (name, globals, locals, fromlist))
-        self.newModules[name] = 1
-        return result
-        
-    def uninstall(self):
-        for modname in self.newModules.keys():
-            if not self.previousModules.has_key(modname):
-                # Force reload when modname next imported
-                del(sys.modules[modname])
-        __builtin__.__import__ = self.realImport