[Bf-blender-cvs] [90b0fb135fd] master: PyAPI: remove deprecated bpy.app.binary_path_python

Campbell Barton noreply at git.blender.org
Mon Jun 14 15:54:51 CEST 2021


Commit: 90b0fb135fdd06055d42f22396120e812440122d
Author: Campbell Barton
Date:   Mon Jun 14 23:50:24 2021 +1000
Branches: master
https://developer.blender.org/rB90b0fb135fdd06055d42f22396120e812440122d

PyAPI: remove deprecated bpy.app.binary_path_python

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

M	source/blender/python/intern/bpy_app.c
M	tests/python/bl_test.py

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

diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 4de6063098b..a89d97bb40c 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -298,15 +298,6 @@ static int bpy_app_global_flag_set__only_disable(PyObject *UNUSED(self),
   return bpy_app_global_flag_set(NULL, value, closure);
 }
 
-PyDoc_STRVAR(bpy_app_binary_path_python_doc,
-             "String, the path to the python executable (read-only). "
-             "Deprecated! Use ``sys.executable`` instead.");
-static PyObject *bpy_app_binary_path_python_get(PyObject *UNUSED(self), void *UNUSED(closure))
-{
-  PyErr_Warn(PyExc_RuntimeWarning, "Use 'sys.executable' instead of 'binary_path_python'!");
-  return Py_INCREF_RET(PySys_GetObject("executable"));
-}
-
 PyDoc_STRVAR(bpy_app_debug_value_doc,
              "Short, number which can be set to non-zero values for testing purposes");
 static PyObject *bpy_app_debug_value_get(PyObject *UNUSED(self), void *UNUSED(closure))
@@ -441,12 +432,6 @@ static PyGetSetDef bpy_app_getsets[] = {
      bpy_app_global_flag_doc,
      (void *)G_FLAG_USERPREF_NO_SAVE_ON_EXIT},
 
-    {"binary_path_python",
-     bpy_app_binary_path_python_get,
-     NULL,
-     bpy_app_binary_path_python_doc,
-     NULL},
-
     {"debug_value",
      bpy_app_debug_value_get,
      bpy_app_debug_value_set,
diff --git a/tests/python/bl_test.py b/tests/python/bl_test.py
index 110b4238f6c..6315ffbfa9d 100644
--- a/tests/python/bl_test.py
+++ b/tests/python/bl_test.py
@@ -32,18 +32,9 @@ def replace_bpy_app_version():
     app = bpy.app
     app_fake = type(bpy)("bpy.app")
 
-    app_attr_exclude = {
-        # This causes a noisy warning every time.
-        "binary_path_python",
-    }
-
     for attr in dir(app):
-        if attr.startswith("_"):
-            continue
-        if attr in app_attr_exclude:
-            continue
-
-        setattr(app_fake, attr, getattr(app, attr))
+        if not attr.startswith("_"):
+            setattr(app_fake, attr, getattr(app, attr))
 
     app_fake.version = 0, 0, 0
     app_fake.version_string = "0.00 (sub 0)"



More information about the Bf-blender-cvs mailing list