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:
Diffstat (limited to 'source/blender/python/intern/bpy_app.c')
-rw-r--r--source/blender/python/intern/bpy_app.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 9f83bc94760..538ff7ba257 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -236,7 +236,7 @@ static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *clos
PyDoc_STRVAR(bpy_app_binary_path_python_doc,
"String, the path to the python executable (read-only)"
);
-static PyObject *bpy_app_binary_path_python_get(PyObject *UNUSED(self), void *UNUSED(closure))
+static PyObject *bpy_app_binary_path_python_get(PyObject *self, void *UNUSED(closure))
{
/* refcount is held in BlenderAppType.tp_dict */
static PyObject *ret = NULL;
@@ -248,7 +248,7 @@ static PyObject *bpy_app_binary_path_python_get(PyObject *UNUSED(self), void *UN
fullpath, sizeof(fullpath),
PY_MAJOR_VERSION, PY_MINOR_VERSION);
ret = PyC_UnicodeFromByte(fullpath);
- PyDict_SetItemString(BlenderAppType.tp_dict, "binary_path_python", ret);
+ PyDict_SetItem(BlenderAppType.tp_dict, PyDescr_NAME(self), ret);
}
else {
Py_INCREF(ret);
@@ -363,10 +363,10 @@ static PyGetSetDef bpy_app_getsets[] = {
static void py_struct_seq_getset_init(void)
{
/* tricky dynamic members, not to py-spec! */
- PyGetSetDef *getset;
-
- for (getset = bpy_app_getsets; getset->name; getset++) {
- PyDict_SetItemString(BlenderAppType.tp_dict, getset->name, PyDescr_NewGetSet(&BlenderAppType, getset));
+ for (PyGetSetDef *getset = bpy_app_getsets; getset->name; getset++) {
+ PyObject *item = PyDescr_NewGetSet(&BlenderAppType, getset);
+ PyDict_SetItem(BlenderAppType.tp_dict, PyDescr_NAME(item), item);
+ Py_DECREF(item);
}
}
/* end dynamic bpy.app */