summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2022-07-05 15:40:17 (GMT)
committerGitHub <noreply@github.com>2022-07-05 15:40:17 (GMT)
commit49aeda989d9385eb4f0c41f7a7e4854037a7abfb (patch)
treef854825d1d3f3b518cdd575697c97a8518ddb850 /Lib/distutils
parent7a3dae06eb6ff822b47ee8ed01dd840139cb994c (diff)
downloadcpython-49aeda989d9385eb4f0c41f7a7e4854037a7abfb.zip
cpython-49aeda989d9385eb4f0c41f7a7e4854037a7abfb.tar.gz
cpython-49aeda989d9385eb4f0c41f7a7e4854037a7abfb.tar.bz2
[3.11] gh-92897: Ensure `venv --copies` respects source build property of the creating interpreter (GH-92899) (GH-94567)
(cherry picked from commit 067597522a9002f3b8aff7f46033f10acb2381e4) Co-authored-by: Jeremy Kloth <jeremy.kloth@gmail.com>
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/sysconfig.py7
-rw-r--r--Lib/distutils/tests/test_sysconfig.py6
2 files changed, 6 insertions, 7 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 3414a76..03b8558 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -30,8 +30,6 @@ from sysconfig import (
parse_config_h as sysconfig_parse_config_h,
_init_non_posix,
- _is_python_source_dir,
- _sys_home,
_variable_rx,
_findvar1_rx,
@@ -52,9 +50,6 @@ from sysconfig import (
# which might not be true in the time of import.
_config_vars = get_config_vars()
-if os.name == "nt":
- from sysconfig import _fix_pcbuild
-
warnings.warn(
'The distutils.sysconfig module is deprecated, use sysconfig instead',
DeprecationWarning,
@@ -287,7 +282,7 @@ def get_python_inc(plat_specific=0, prefix=None):
# must use "srcdir" from the makefile to find the "Include"
# directory.
if plat_specific:
- return _sys_home or project_base
+ return project_base
else:
incdir = os.path.join(get_config_var('srcdir'), 'Include')
return os.path.normpath(incdir)
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index 0664aca..d1c4727 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -61,7 +61,11 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
# should be a full source checkout.
Python_h = os.path.join(srcdir, 'Include', 'Python.h')
self.assertTrue(os.path.exists(Python_h), Python_h)
- self.assertTrue(sysconfig._is_python_source_dir(srcdir))
+ # <srcdir>/PC/pyconfig.h always exists even if unused on POSIX.
+ pyconfig_h = os.path.join(srcdir, 'PC', 'pyconfig.h')
+ self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h)
+ pyconfig_h_in = os.path.join(srcdir, 'pyconfig.h.in')
+ self.assertTrue(os.path.exists(pyconfig_h_in), pyconfig_h_in)
elif os.name == 'posix':
self.assertEqual(
os.path.dirname(sysconfig.get_makefile_filename()),