mirror of
https://github.com/python/cpython.git
synced 2025-11-10 02:21:40 +00:00
Changed distutils tests to avoid environment alteration
This commit is contained in:
parent
11abfe640f
commit
2b06d42db5
13 changed files with 67 additions and 34 deletions
|
|
@ -34,7 +34,7 @@ def setUp(self):
|
|||
# Note that we're making changes to sys.path
|
||||
super(BuildExtTestCase, self).setUp()
|
||||
self.tmp_dir = self.mkdtemp()
|
||||
self.sys_path = sys.path[:]
|
||||
self.sys_path = sys.path, sys.path[:]
|
||||
sys.path.append(self.tmp_dir)
|
||||
shutil.copy(_get_source_filename(), self.tmp_dir)
|
||||
if sys.version > "2.6":
|
||||
|
|
@ -89,7 +89,8 @@ def test_build_ext(self):
|
|||
def tearDown(self):
|
||||
# Get everything back to normal
|
||||
test_support.unload('xx')
|
||||
sys.path = self.sys_path
|
||||
sys.path = self.sys_path[0]
|
||||
sys.path[:] = self.sys_path[1]
|
||||
if sys.version > "2.6":
|
||||
import site
|
||||
site.USER_BASE = self.old_user_base
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue