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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-22 18:05:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-22 18:05:08 +0400
commit676c2924d933d6116081de999cf51af72a9b512b (patch)
tree293e6d6c23e5124d9b03267f8774e295865f378e /source/blender/python
parent47853bf6f6fa7ab4dc523fe255a8253b7ae9f914 (diff)
fix [#29319] bus error with python with link_append and {}
patch from Emil Brink
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/py_capi_utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 7fbd8baa558..8d68a407e62 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -385,8 +385,12 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
if (PyBytes_Check(py_str)) {
return PyBytes_AS_STRING(py_str);
}
+ else if ((*coerce= PyUnicode_EncodeFSDefault(py_str))) {
+ return PyBytes_AS_STRING(*coerce);
+ }
else {
- return PyBytes_AS_STRING((*coerce= PyUnicode_EncodeFSDefault(py_str)));
+ /* leave error raised from EncodeFS */
+ return NULL;
}
}
}