Commits

Hanno Schlichting  committed 7a42192

Packages required at build time where not fully present at install time. This closes #12.

  • Participants
  • Parent commits 038ed07
  • Branches setuptools-0.6

Comments (0)

Files changed (2)

File setuptools.txt

 ----------------------------
 
 0.6final
+ * Packages required at build time where not fully present at install time.
+   This closes http://bitbucket.org/tarek/distribute/issue/12.
+
  * Protected against failures in tarfile extraction. This closes
    http://bitbucket.org/tarek/distribute/issue/10.
 

File setuptools/sandbox.py

 __all__ = [
     "AbstractSandbox", "DirectorySandbox", "SandboxViolation", "run_setup",
 ]
-
 def run_setup(setup_script, args):
     """Run a distutils setup script, sandboxed in its directory"""
-
     old_dir = os.getcwd()
     save_argv = sys.argv[:]
     save_path = sys.path[:]
     temp_dir = os.path.join(setup_dir,'temp')
     if not os.path.isdir(temp_dir): os.makedirs(temp_dir)
     save_tmp = tempfile.tempdir
-
+    save_modules = sys.modules.copy()
     try:
         tempfile.tempdir = temp_dir
         os.chdir(setup_dir)
                 raise
             # Normal exit, just return
     finally:
+        sys.modules.update(save_modules)
+        for key in list(sys.modules):
+            if key not in save_modules: del sys.modules[key]
         os.chdir(old_dir)
         sys.path[:] = save_path
         sys.argv[:] = save_argv