diff options
author | Éric Araujo <merwok@netwok.org> | 2011-06-16 23:43:15 +0200 |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-06-16 23:43:15 +0200 |
commit | 6f67765389f63b49c094ee08017309bcb45d7ed6 (patch) | |
tree | af25aaec48f44dfb11bac27c5919e6884f7249d3 /Lib/packaging/tests/test_command_build_ext.py | |
parent | b6be20ca337348b7cf2b356f9354a4121627add0 (diff) | |
download | cpython-git-6f67765389f63b49c094ee08017309bcb45d7ed6.tar.gz |
Stop binding sys.path as default parameter value in packaging.
The two public functions in database default to sys.path if the given
*paths* argument is None; the private functions don’t have default
values for their arguments anymore, which is fine as the public
functions that call them pass their arguments down. Likewise in
install, the functions will pass down their *paths* arguments down to
database functions.
A one-line unneeded function in install was removed instead of being
changed, and the few remaining tests that used brute-force restoration
of sys.path have been cleaned up to use sys.path.remove.
Diffstat (limited to 'Lib/packaging/tests/test_command_build_ext.py')
-rw-r--r-- | Lib/packaging/tests/test_command_build_ext.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/packaging/tests/test_command_build_ext.py b/Lib/packaging/tests/test_command_build_ext.py index 9729559865..d8936d449e 100644 --- a/Lib/packaging/tests/test_command_build_ext.py +++ b/Lib/packaging/tests/test_command_build_ext.py @@ -29,7 +29,6 @@ class BuildExtTestCase(support.TempdirManager, # Note that we're making changes to sys.path super(BuildExtTestCase, self).setUp() self.tmp_dir = self.mkdtemp() - self.sys_path = sys.path, sys.path[:] sys.path.append(self.tmp_dir) filename = _get_source_filename() if os.path.exists(filename): @@ -107,8 +106,7 @@ class BuildExtTestCase(support.TempdirManager, def tearDown(self): # Get everything back to normal unload('xx') - sys.path = self.sys_path[0] - sys.path[:] = self.sys_path[1] + sys.path.remove(self.tmp_dir) if sys.version > "2.6": site.USER_BASE = self.old_user_base build_ext.USER_BASE = self.old_user_base |