Commit 9456da48 authored by Ronny Pfannschmidt's avatar Ronny Pfannschmidt

make HAS_USER_SITE depend on site.ENABLE_USER_SITE

--HG--
branch : distribute
extra : rebase_source : e7fb6337b41ea732acd41bab92a57471f3632777
parent 0c8f3ad9
...@@ -39,7 +39,7 @@ __all__ = [ ...@@ -39,7 +39,7 @@ __all__ = [
] ]
import site import site
HAS_USER_SITE = not sys.version < "2.6" HAS_USER_SITE = not sys.version < "2.6" and site.ENABLE_USER_SITE
def samefile(p1,p2): def samefile(p1,p2):
if hasattr(os.path,'samefile') and ( if hasattr(os.path,'samefile') and (
...@@ -122,7 +122,7 @@ class easy_install(Command): ...@@ -122,7 +122,7 @@ class easy_install(Command):
create_index = PackageIndex create_index = PackageIndex
def initialize_options(self): def initialize_options(self):
if HAS_USER_SITE and site.ENABLE_USER_SITE: if HAS_USER_SITE:
whereami = os.path.abspath(__file__) whereami = os.path.abspath(__file__)
self.user = whereami.startswith(site.USER_SITE) self.user = whereami.startswith(site.USER_SITE)
else: else:
...@@ -1347,8 +1347,7 @@ def get_site_dirs(): ...@@ -1347,8 +1347,7 @@ def get_site_dirs():
site_lib = get_python_lib(plat_specific) site_lib = get_python_lib(plat_specific)
if site_lib not in sitedirs: sitedirs.append(site_lib) if site_lib not in sitedirs: sitedirs.append(site_lib)
if sys.version >= "2.6": if HAS_USER_SITE:
import site
sitedirs.append(site.USER_SITE) sitedirs.append(site.USER_SITE)
sitedirs = map(normalize_path, sitedirs) sitedirs = map(normalize_path, sitedirs)
......
...@@ -158,7 +158,7 @@ class TestUserInstallTest(unittest.TestCase): ...@@ -158,7 +158,7 @@ class TestUserInstallTest(unittest.TestCase):
self.old_cwd = os.getcwd() self.old_cwd = os.getcwd()
os.chdir(self.dir) os.chdir(self.dir)
if sys.version >= "2.6": if sys.version >= "2.6":
self.old_enable = site.ENABLE_USER_SITE self.old_has_site = easy_install_pkg.HAS_USER_SITE
self.old_file = easy_install_pkg.__file__ self.old_file = easy_install_pkg.__file__
self.old_base = site.USER_BASE self.old_base = site.USER_BASE
site.USER_BASE = tempfile.mkdtemp() site.USER_BASE = tempfile.mkdtemp()
...@@ -174,11 +174,11 @@ class TestUserInstallTest(unittest.TestCase): ...@@ -174,11 +174,11 @@ class TestUserInstallTest(unittest.TestCase):
shutil.rmtree(site.USER_SITE) shutil.rmtree(site.USER_SITE)
site.USER_BASE = self.old_base site.USER_BASE = self.old_base
site.USER_SITE = self.old_site site.USER_SITE = self.old_site
site.ENABLE_USER_SITE = self.old_enable easy_install_pkg.HAS_USER_SITE = self.old_has_site
easy_install_pkg.__file__ = self.old_file easy_install_pkg.__file__ = self.old_file
def test_user_install_implied(self): def test_user_install_implied(self):
site.ENABLE_USER_SITE = True # disabled sometimes easy_install_pkg.HAS_USER_SITE = True # disabled sometimes
#XXX: replace with something meaningfull #XXX: replace with something meaningfull
if sys.version < "2.6": if sys.version < "2.6":
return #SKIP return #SKIP
...@@ -195,7 +195,7 @@ class TestUserInstallTest(unittest.TestCase): ...@@ -195,7 +195,7 @@ class TestUserInstallTest(unittest.TestCase):
_LOG.info('this should not break') _LOG.info('this should not break')
def test_user_install_not_implied_without_usersite_enabled(self): def test_user_install_not_implied_without_usersite_enabled(self):
site.ENABLE_USER_SITE = False # disabled sometimes easy_install_pkg.HAS_USER_SITE = False # usually enabled
#XXX: replace with something meaningfull #XXX: replace with something meaningfull
if sys.version < "2.6": if sys.version < "2.6":
return #SKIP return #SKIP
......
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