Fix #115648: Crash on startup with an incompatible PYTHONPATH

Regression in [0]. PyPreConfig.use_environment was internalized to 0
but PyConfig.use_environment wasn't.

Thanks to @unwave for finding the root cause.

[0]: cafd6b519c5f5c4b67d0dfe3d453cd4223b38716
This commit is contained in:
Campbell Barton 2024-05-03 15:27:10 +10:00
parent d46fe49ab3
commit cd5dd6e454

@ -385,7 +385,12 @@ void BPY_python_start(bContext *C, int argc, const char **argv)
PyStatus status;
bool has_python_executable = false;
PyConfig_InitPythonConfig(&config);
if (py_use_system_env) {
PyConfig_InitPythonConfig(&config);
}
else {
PyConfig_InitIsolatedConfig(&config);
}
/* Suppress error messages when calculating the module search path.
* While harmless, it's noisy. */