0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

obs-scripting: Load obspython.py from Resources on macOS

This commit is contained in:
derrod 2022-03-23 05:45:03 +01:00 committed by Rodney
parent b65ee7e7fb
commit afa8527723

View File

@ -1676,10 +1676,24 @@ bool obs_scripting_load_python(const char *python_path)
bfree(absolute_script_path);
#if __APPLE__
char *exec_path = os_get_executable_path_ptr("");
if (exec_path)
add_to_python_path(exec_path);
bfree(exec_path);
char *absolute_exec_path = os_get_executable_path_ptr("");
if (absolute_exec_path != NULL) {
add_to_python_path(absolute_exec_path);
struct dstr resources_path;
dstr_init_move_array(&resources_path, absolute_exec_path);
dstr_cat(&resources_path, "../Resources");
char *absolute_resources_path = os_get_abs_path_ptr(resources_path.array);
if (absolute_resources_path != NULL) {
add_to_python_path(absolute_resources_path);
bfree(absolute_resources_path);
}
dstr_free(&resources_path);
bfree(absolute_exec_path);
}
#endif
py_obspython = PyImport_ImportModule("obspython");