mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Merged revisions 77704,77752 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77704 | tarek.ziade | 2010-01-23 10:23:15 +0100 (Sat, 23 Jan 2010) | 1 line taking sysconfig out of distutils ........ r77752 | tarek.ziade | 2010-01-26 00:19:56 +0100 (Tue, 26 Jan 2010) | 1 line switched the call order so this call works without suffering from issue #7774 ........
This commit is contained in:
parent
82b8398583
commit
edacea30e4
35 changed files with 1193 additions and 926 deletions
|
@ -11,6 +11,9 @@ import os
|
|||
import sys
|
||||
import encodings
|
||||
import subprocess
|
||||
import sysconfig
|
||||
from copy import copy
|
||||
|
||||
# Need to make sure to not import 'site' if someone specified ``-S`` at the
|
||||
# command-line. Detect this by just making sure 'site' has not been imported
|
||||
# already.
|
||||
|
@ -38,6 +41,7 @@ class HelperFunctionsTests(unittest.TestCase):
|
|||
self.old_base = site.USER_BASE
|
||||
self.old_site = site.USER_SITE
|
||||
self.old_prefixes = site.PREFIXES
|
||||
self.old_vars = copy(sysconfig._CONFIG_VARS)
|
||||
|
||||
def tearDown(self):
|
||||
"""Restore sys.path"""
|
||||
|
@ -45,6 +49,7 @@ class HelperFunctionsTests(unittest.TestCase):
|
|||
site.USER_BASE = self.old_base
|
||||
site.USER_SITE = self.old_site
|
||||
site.PREFIXES = self.old_prefixes
|
||||
sysconfig._CONFIG_VARS = self.old_vars
|
||||
|
||||
def test_makepath(self):
|
||||
# Test makepath() have an absolute path for its first return value
|
||||
|
@ -137,6 +142,9 @@ class HelperFunctionsTests(unittest.TestCase):
|
|||
|
||||
# let's set PYTHONUSERBASE and see if it uses it
|
||||
site.USER_BASE = None
|
||||
import sysconfig
|
||||
sysconfig._CONFIG_VARS = None
|
||||
|
||||
with EnvironmentVarGuard() as environ:
|
||||
environ['PYTHONUSERBASE'] = 'xoxo'
|
||||
self.assertTrue(site.getuserbase().startswith('xoxo'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue