[Bf-blender-cvs] [8438ef4d8e3] master: Cleanup: update comments, remove disabled code

Campbell Barton noreply at git.blender.org
Thu Jul 23 06:05:12 CEST 2020


Commit: 8438ef4d8e33f542fc7c93c6e8983bffa6667ab8
Author: Campbell Barton
Date:   Thu Jul 23 14:04:18 2020 +1000
Branches: master
https://developer.blender.org/rB8438ef4d8e33f542fc7c93c6e8983bffa6667ab8

Cleanup: update comments, remove disabled code

===================================================================

M	source/blender/python/generic/py_capi_utils.c

===================================================================

diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 1051780d821..f46588206ee 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -804,8 +804,12 @@ void PyC_MainModule_Restore(PyObject *main_mod)
   Py_XDECREF(main_mod);
 }
 
-/* Must be called before Py_Initialize,
- * expects output of BKE_appdir_folder_id(BLENDER_PYTHON, NULL). */
+/**
+ * - Must be called before #Py_Initialize.
+ * - Expects output of `BKE_appdir_folder_id(BLENDER_PYTHON, NULL)`.
+ * - Note that the `PYTHONPATH` environment variable isn't reliable, see T31506.
+     Use #Py_SetPythonHome instead.
+ */
 void PyC_SetHomePath(const char *py_path_bundle)
 {
   if (py_path_bundle == NULL) {
@@ -824,20 +828,10 @@ void PyC_SetHomePath(const char *py_path_bundle)
   /* 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, ':')) {
-    printf(
-        "Warning : Blender application is located in a path containing : or / chars\
-           \nThis may make python import function fail\n");
-  }
-#  endif
-
-#  if 0 /* disable for now [#31506] - campbell */
-#    ifdef _WIN32
-  /* cmake/MSVC debug build crashes without this, why only
-   * in this case is unknown.. */
-  {
-    /*BLI_setenv("PYTHONPATH", 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
 #  endif
 
   {



More information about the Bf-blender-cvs mailing list