fix [#29319] bus error with python with link_append and {}

patch from Emil Brink
This commit is contained in:
2011-11-22 14:05:08 +00:00
parent 47853bf6f6
commit 676c2924d9

View File

@@ -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;
}
}
}