Commit bab0fa4b authored by tarek's avatar tarek

merged Hanno changes

--HG--
branch : distribute
extra : rebase_source : 2e46353034168a7bcd07262487eb3441f9dce383
parents 13dbd1a1 d7db8bf8
......@@ -3,9 +3,12 @@ CHANGES
=======
setuptools
---------
----------
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.
......
......@@ -2606,7 +2606,6 @@ XXX
XXX
Mailing List and Bug Tracker
============================
......
......@@ -6,10 +6,8 @@ from distutils.errors import DistutilsError
__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[:]
......@@ -17,7 +15,7 @@ def run_setup(setup_script, args):
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)
......@@ -35,6 +33,9 @@ def run_setup(setup_script, args):
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment