summaryrefslogtreecommitdiff
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2013-06-12 03:53:21 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2013-06-12 03:53:21 +0200
commitc04abca662dcbffd00d928e06fbf32b9f49f8e57 (patch)
tree992aca304622ab80b44630cb287c44bac0a2941a /setuptools/command/easy_install.py
parent0dfd7768a9a75bec3c2592b8d0b2a4fed4d825ab (diff)
downloadpython-setuptools-git-c04abca662dcbffd00d928e06fbf32b9f49f8e57.tar.gz
Use new sysconfig module with Python 2.7 or >=3.2.
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index b90fee0a..60b3e011 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -25,9 +25,22 @@ import pkg_resources
from setuptools import Command, _dont_write_bytecode
from setuptools.sandbox import run_setup
from distutils import log, dir_util
+try:
+ # Python 2.7 or >=3.2
+ from sysconfig import get_config_vars, get_path
+ def _get_platlib():
+ return get_path("platlib")
+ def _get_purelib():
+ return get_path("purelib")
+except ImportError:
+ from distutils.sysconfig import get_config_vars, get_python_lib
+ def _get_platlib():
+ return get_python_lib(True)
+ def _get_purelib():
+ return get_python_lib(False)
+
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
-from distutils.sysconfig import get_python_lib, get_config_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
DistutilsError, DistutilsPlatformError
from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS
@@ -1398,8 +1411,7 @@ def get_site_dirs():
'Python',
sys.version[:3],
'site-packages'))
- for plat_specific in (0,1):
- site_lib = get_python_lib(plat_specific)
+ for site_lib in (_get_purelib(), _get_platlib()):
if site_lib not in sitedirs: sitedirs.append(site_lib)
if HAS_USER_SITE: