]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-150162: Fix sysconfig cross-compile impermanence (#150164)
authorhetmankp <728670+hetmankp@users.noreply.github.com>
Mon, 22 Jun 2026 15:59:03 +0000 (01:59 +1000)
committerGitHub <noreply@github.com>
Mon, 22 Jun 2026 15:59:03 +0000 (15:59 +0000)
commit0bd1024f87a55a18340e06837e83713888f218a7
tree9882047843b0397bd74b1c82af0f90161995bd59
parent0d540afcec0ead73620edb675ebdc47925ba581f
gh-150162: Fix sysconfig cross-compile impermanence (#150164)

Fixes issue #150162 by improving the code introduced by 70154855cf69
(GH-127729) while retaining the original documented intent. The
aforementioned code has a side effect when used in a virtual environment
context, on posix platforms, with the cross-compiling environment
variable _PYTHON_PROJECT_BASE present. In this case, every single
sysconfig.get_config_vars() and sysconfig.get_config_var() call, forces
the _CONFIG_VARS dictionary to be reinitialised from scratch. This is
inefficient, but also means no changes to the dictionary returned by
sysconfig.get_config_vars() persist, which can be useful in certain
situations.

This commit tracks changes to sys.prefix and sys.exec_prefix more
directly rather than relying on a misalignment with the corresponding
sysconfig variables.
Lib/sysconfig/__init__.py