diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-28 11:43:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-28 11:43:58 +0300 |
commit | 02ecf29d05c5f5db743f52bcdd441eed3e146e83 (patch) | |
tree | e44908f88b18bf2fbcc94cda16c6885cb7f524e6 | |
parent | 6527a14cd2ceaaf529beae522ca594bb250b56c9 (diff) | |
parent | a8ca79cbe694ee7639343695d6367d30cb2ab589 (diff) |
Merge branch 'blender-v2.91-release'
-rw-r--r-- | release/scripts/modules/sys_info.py | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 20 |
2 files changed, 7 insertions, 17 deletions
diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index cb80529f0f3..fc3ffe4dd88 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -82,10 +82,10 @@ def write_sysinfo(filepath): output.write("\t%r\n" % p) output.write(title("Python (External Binary)")) - output.write("binary path: %s\n" % prepr(sys.executable)) + output.write("binary path: %s\n" % prepr(bpy.app.binary_path_python)) try: py_ver = prepr(subprocess.check_output([ - sys.executable, + bpy.app.binary_path_python, "--version", ]).strip()) except Exception as e: diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index e8d309b8a50..e3afe49b22f 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -306,22 +306,12 @@ void BPY_python_start(bContext *C, int argc, const char **argv) PyThreadState *py_tstate = NULL; const char *py_path_bundle = BKE_appdir_folder_id(BLENDER_SYSTEM_PYTHON, NULL); - /* Setting the program name is important so the 'multiprocessing' module - * can launch new Python instances. */ + /* Not essential but nice to set our name. */ { - char program_path[FILE_MAX]; - if (BKE_appdir_program_python_search( - program_path, sizeof(program_path), PY_MAJOR_VERSION, PY_MINOR_VERSION)) { - wchar_t program_path_wchar[FILE_MAX]; - BLI_strncpy_wchar_from_utf8( - program_path_wchar, program_path, ARRAY_SIZE(program_path_wchar)); - Py_SetProgramName(program_path_wchar); - } - else { - fprintf(stderr, - "Unable to find the python binary, " - "the multiprocessing module may not be functional!\n"); - } + const char *program_path = BKE_appdir_program_path(); + wchar_t program_path_wchar[FILE_MAX]; + BLI_strncpy_wchar_from_utf8(program_path_wchar, program_path, ARRAY_SIZE(program_path_wchar)); + Py_SetProgramName(program_path_wchar); } /* must run before python initializes */ |