From e66e4f7981fb82d70b45c360ec9fbcddd4c4a56b Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Tue, 7 Nov 2023 22:44:38 +0530 Subject: [PATCH] fixup! sysconfig: make _sysconfigdata.py relocatable Use `sys.base_prefix` for sysconfig relocation Previously, we were using `sys.prefix` for relocation, which is not right as it may change for virtualenvs. `sys.base_prefix` is the right variable to use. --- Lib/sysconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 8035d2e273e33c..f359835c636b8e 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -542,7 +542,7 @@ def _generate_posix_vars(): for key in keys_to_replace: value = build_time_vars[key] - build_time_vars[key] = value.replace(prefix, sys.prefix) + build_time_vars[key] = value.replace(prefix, sys.base_prefix) """ with open(destfile, 'w', encoding='utf8') as f: