Commit 8a94f99b authored by Jason R. Coombs's avatar Jason R. Coombs

Extract py31compat module for get_config_vars and get_path

parent bc47a75d
......@@ -32,19 +32,7 @@ from distutils import log, dir_util
import pkg_resources
from setuptools import Command, _dont_write_bytecode
from setuptools.sandbox import run_setup
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 setuptools.py31compat import get_path, get_config_vars
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
......@@ -1288,7 +1276,8 @@ def get_site_dirs():
'Python',
sys.version[:3],
'site-packages'))
for site_lib in (_get_purelib(), _get_platlib()):
lib_paths = get_path('purelib'), get_path('platlib')
for site_lib in lib_paths:
if site_lib not in sitedirs: sitedirs.append(site_lib)
if HAS_USER_SITE:
......
__all__ = ['get_config_vars', 'get_path']
try:
# Python 2.7 or >=3.2
from sysconfig import get_config_vars, get_path
except ImportError:
from distutils.sysconfig import get_config_vars, get_python_lib
def get_path(name):
if name not in ('platlib', 'purelib'):
raise ValueError("Name must be purelib or platlib")
return get_python_lib(name=='platlib')
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