aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-03-06 23:21:01 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-03-06 23:21:01 -0500
commit727f1668fc61f74867cc0cfdfabdd6d23699a6d9 (patch)
treeed6f610e02dc24329d29d299a905f2634c425c25 /setuptools/command/easy_install.py
parent3a8d4728cbc3080a7a816f87dc20efafae6e28e5 (diff)
downloadexternal_python_setuptools-727f1668fc61f74867cc0cfdfabdd6d23699a6d9.tar.gz
external_python_setuptools-727f1668fc61f74867cc0cfdfabdd6d23699a6d9.tar.bz2
external_python_setuptools-727f1668fc61f74867cc0cfdfabdd6d23699a6d9.zip
Use short circuit instead of nesting functionality.
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 872f6bb8..efe5f68b 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -336,14 +336,16 @@ class easy_install(Command):
"""
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)
+ if not self.user or not site.ENABLE_USER_SITE:
+ return
+
+ 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: