Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-02-22 13:20:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-22 13:20:48 +0300
commit06212759bc7285a131c3ee811aec1ee240841c2c (patch)
tree40b6208075cedd213774eaa20d9e9fda502440cd /source/blender/python/intern/bpy_interface.c
parentb4147aeeab7d34552a7b7bfe45a9d03217bcdc33 (diff)
Fix missing NULL check on macOS when system-python isn't found
Regression from cafd6b519c5f5c4b67d0dfe3d453cd4223b38716. D10494 by @ysano with edits.
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 9fea65935e1..c5f5e9c71b8 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -419,16 +419,19 @@ void BPY_python_start(bContext *C, int argc, const char **argv)
/* Allow to use our own included Python. `py_path_bundle` may be NULL. */
{
const char *py_path_bundle = BKE_appdir_folder_id(BLENDER_SYSTEM_PYTHON, NULL);
-# ifdef __APPLE__
- /* OSX allow file/directory names to contain : character (represented as / in the Finder)
- * but current Python lib (release 3.1.1) doesn't handle these correctly */
- if (strchr(py_path_bundle, ':')) {
- fprintf(stderr,
- "Warning! Blender application is located in a path containing ':' or '/' chars\n"
- "This may make python import function fail\n");
- }
-# endif
if (py_path_bundle != NULL) {
+
+# ifdef __APPLE__
+ /* Mac-OS allows file/directory names to contain `:` character
+ * (represented as `/` in the Finder) but current Python lib (as of release 3.1.1)
+ * doesn't handle these correctly. */
+ if (strchr(py_path_bundle, ':')) {
+ fprintf(stderr,
+ "Warning! Blender application is located in a path containing ':' or '/' chars\n"
+ "This may make python import function fail\n");
+ }
+# endif /* __APPLE__ */
+
status = PyConfig_SetBytesString(&config, &config.home, py_path_bundle);
pystatus_exit_on_error(status);
}