From: Victor Stinner Date: Wed, 17 May 2017 00:59:24 +0000 (-0700) Subject: bpo-30273: update distutils.sysconfig for venv's created from Python (#1515) (#1626) X-Git-Tag: v3.5.4rc1~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f01c0ec9fe571e8afd50d2f5180db3c0d7b613af;p=thirdparty%2FPython%2Fcpython.git bpo-30273: update distutils.sysconfig for venv's created from Python (#1515) (#1626) compiled out-of-tree (builddir != srcdir). (see also bpo-15366) (cherry picked from commit dbdea629e2e0e4bd8845aa55041e0a0ca4172cf3) --- diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 4f321352151d..bd19ebf5158b 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -93,14 +93,11 @@ def get_python_inc(plat_specific=0, prefix=None): # the build directory may not be the source directory, we # must use "srcdir" from the makefile to find the "Include" # directory. - base = _sys_home or project_base if plat_specific: - return base - if _sys_home: - incdir = os.path.join(_sys_home, 'Include') + return _sys_home or project_base else: incdir = os.path.join(get_config_var('srcdir'), 'Include') - return os.path.normpath(incdir) + return os.path.normpath(incdir) python_dir = 'python' + get_python_version() + build_flags return os.path.join(prefix, "include", python_dir) elif os.name == "nt":