mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
frontend-tools: Upgrade legacy Python library paths to modern format
Updates the value at runtime and also stores it in the configuration.
This commit is contained in:
parent
c4f12f9055
commit
ff4f4fcb92
@ -652,6 +652,19 @@ extern "C" void InitScripts()
|
||||
const char *python_path =
|
||||
config_get_string(config, "Python", "Path" ARCH_NAME);
|
||||
|
||||
#ifdef __APPLE__
|
||||
std::string _python_path(python_path);
|
||||
std::size_t pos = _python_path.find("/Python.framework/Versions");
|
||||
|
||||
if (pos != std::string::npos) {
|
||||
std::string _temp = _python_path.substr(0, pos);
|
||||
config_set_string(config, "Python", "Path" ARCH_NAME,
|
||||
_temp.c_str());
|
||||
config_save(config);
|
||||
python_path = _temp.c_str();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!obs_scripting_python_loaded() && python_path && *python_path)
|
||||
obs_scripting_load_python(python_path);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user