bpo-46890: Fix setting of sys._base_executable with framework builds on macOS (GH-31958)

The side effect of this bug was that venv environments directly
used the main interpreter instead of the intermediate stub executable,
which can cause problems when a script uses system APIs that
require the use of an application bundle.
This commit is contained in:
Ronald Oussoren 2022-04-05 08:05:36 +02:00 committed by GitHub
parent a0c700480b
commit 6aaf4cd866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 200 additions and 2 deletions

View file

@ -875,6 +875,11 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config)
!decode_to_dict(dict, "os_name", "darwin") ||
#else
!decode_to_dict(dict, "os_name", "posix") ||
#endif
#ifdef WITH_NEXT_FRAMEWORK
!int_to_dict(dict, "WITH_NEXT_FRAMEWORK", 1) ||
#else
!int_to_dict(dict, "WITH_NEXT_FRAMEWORK", 0) ||
#endif
!decode_to_dict(dict, "PREFIX", PREFIX) ||
!decode_to_dict(dict, "EXEC_PREFIX", EXEC_PREFIX) ||
@ -943,3 +948,4 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config)
return _PyStatus_OK();
}