Commit f99148d
committed
gh-150162: Fix sysconfig cross-compile impermanence
Fixes issue #150162 by improving the code introduced by 7015485
(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.1 parent d948eaa commit f99148d
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
| |||
597 | 599 | | |
598 | 600 | | |
599 | 601 | | |
| 602 | + | |
| 603 | + | |
600 | 604 | | |
601 | 605 | | |
| 606 | + | |
| 607 | + | |
602 | 608 | | |
603 | 609 | | |
604 | | - | |
605 | | - | |
606 | | - | |
| 610 | + | |
607 | 611 | | |
608 | 612 | | |
609 | 613 | | |
| 614 | + | |
| 615 | + | |
610 | 616 | | |
611 | 617 | | |
612 | 618 | | |
| |||
616 | 622 | | |
617 | 623 | | |
618 | 624 | | |
| 625 | + | |
| 626 | + | |
619 | 627 | | |
620 | 628 | | |
621 | 629 | | |
| |||
0 commit comments