aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-03-06 23:19:23 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-03-06 23:19:23 -0500
commit3a8d4728cbc3080a7a816f87dc20efafae6e28e5 (patch)
tree5e399e3ac15f04071caa50afea97297058a6c0a3 /setuptools/command/easy_install.py
parent126161426c858f6b3e73a330086d9bb0d2995a12 (diff)
downloadexternal_python_setuptools-3a8d4728cbc3080a7a816f87dc20efafae6e28e5.tar.gz
external_python_setuptools-3a8d4728cbc3080a7a816f87dc20efafae6e28e5.tar.bz2
external_python_setuptools-3a8d4728cbc3080a7a816f87dc20efafae6e28e5.zip
Extract method for fixing install dir
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index c35ae16c..872f6bb8 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -237,15 +237,7 @@ class easy_install(Command):
self.config_vars['userbase'] = self.install_userbase
self.config_vars['usersite'] = self.install_usersite
- # fix the install_dir if "--user" was used
- if self.user and site.ENABLE_USER_SITE:
- self.create_home_path()
- if self.install_userbase is None:
- raise DistutilsPlatformError(
- "User base directory is not specified")
- self.install_base = self.install_platbase = self.install_userbase
- scheme_name = os.name.replace('posix', 'unix') + '_user'
- self.select_scheme(scheme_name)
+ self._fix_install_dir_for_user_site()
self.expand_basedirs()
self.expand_dirs()
@@ -340,6 +332,19 @@ class easy_install(Command):
self.outputs = []
+ def _fix_install_dir_for_user_site(self):
+ """
+ Fix the install_dir if "--user" was used.
+ """
+ if self.user and site.ENABLE_USER_SITE:
+ self.create_home_path()
+ if self.install_userbase is None:
+ raise DistutilsPlatformError(
+ "User base directory is not specified")
+ self.install_base = self.install_platbase = self.install_userbase
+ scheme_name = os.name.replace('posix', 'unix') + '_user'
+ self.select_scheme(scheme_name)
+
def _expand_attrs(self, attrs):
for attr in attrs:
val = getattr(self, attr)