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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-09-14 16:40:35 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-09-14 16:54:54 +0300
commitce952fd36e547620a9edb53ccc045536af37ddbe (patch)
tree330fbf047a196c7502de0200266bd1929841f397 /source/blender/python/intern/bpy_app.c
parentab6a3dd6c150d0842d39e6a09b44b806ae2c53c1 (diff)
Fix T49342: TypeError when autocompleting bpy.app.something.
Regression from rB036c006cefe471. We can't use self here, self is bpy.app, not pydescriptor of python path getsetter... So for now, do not try to replace getsetter by actual value in bpy.app's dict, just return static var generated on first run. Should be safe for 2.78.
Diffstat (limited to 'source/blender/python/intern/bpy_app.c')
-rw-r--r--source/blender/python/intern/bpy_app.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 78cb537cccd..ed7cec2f2d5 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -234,7 +234,7 @@ static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *clos
return 0;
}
-
+#define BROKEN_BINARY_PATH_PYTHON_HACK
PyDoc_STRVAR(bpy_app_binary_path_python_doc,
"String, the path to the python executable (read-only)"
@@ -251,14 +251,18 @@ static PyObject *bpy_app_binary_path_python_get(PyObject *self, void *UNUSED(clo
fullpath, sizeof(fullpath),
PY_MAJOR_VERSION, PY_MINOR_VERSION);
ret = PyC_UnicodeFromByte(fullpath);
- PyDict_SetItem(BlenderAppType.tp_dict, PyDescr_NAME(self), ret);
+#ifdef BROKEN_BINARY_PATH_PYTHON_HACK
+ Py_INCREF(ret);
+ UNUSED_VARS(self);
+#else
+ PyDict_SetItem(BlenderAppType.tp_dict, /* XXX BAAAADDDDDD! self is not a PyDescr at all! it's bpy.app!!! */ PyDescr_NAME(self), ret);
+#endif
}
else {
Py_INCREF(ret);
}
return ret;
-
}
PyDoc_STRVAR(bpy_app_debug_value_doc,