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.c')
-rw-r--r--source/blender/python/intern/bpy.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 8a74153646c..e07ac93b098 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -73,12 +73,17 @@ PyDoc_STRVAR(bpy_script_paths_doc,
static PyObject *bpy_script_paths(PyObject *UNUSED(self))
{
PyObject *ret = PyTuple_New(2);
+ PyObject *item;
char *path;
path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL);
- PyTuple_SET_ITEM(ret, 0, PyUnicode_FromString(path?path:""));
+ item = PyUnicode_DecodeFSDefault(path ? path : "");
+ BLI_assert(item != NULL);
+ PyTuple_SET_ITEM(ret, 0, item);
path = BLI_get_folder(BLENDER_USER_SCRIPTS, NULL);
- PyTuple_SET_ITEM(ret, 1, PyUnicode_FromString(path?path:""));
+ item = PyUnicode_DecodeFSDefault(path ? path : "");
+ BLI_assert(item != NULL);
+ PyTuple_SET_ITEM(ret, 1, item);
return ret;
}
@@ -202,7 +207,7 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj
path = BLI_get_folder_version(folder_id, (major * 100) + minor, FALSE);
- return PyUnicode_DecodeFSDefault(path);
+ return PyUnicode_DecodeFSDefault(path ? path : "");
}
static PyMethodDef meth_bpy_script_paths =