New C/Py api utility function PyC_Err_Format_Prefix() which raises an error with the existing error as a suffix.
Use this to raise errors when assigning a string property fails even though the value to assign *is* a string. Before: TypeError: bpy_struct: item.attr= val: Object.name expected a string type, not str After: TypeError: bpy_struct: item.attr= val: Object.name error assigning string, UnicodeEncodeError('utf-8' codec can't encode character '\udce9' in position 23: surrogates not allowed)
This commit is contained in:
@@ -34,6 +34,7 @@ void PyC_ObSpit(const char *name, PyObject *var);
|
||||
void PyC_LineSpit(void);
|
||||
PyObject * PyC_ExceptionBuffer(void);
|
||||
PyObject * PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
|
||||
PyObject * PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *format, ...);
|
||||
void PyC_FileAndNum(const char **filename, int *lineno);
|
||||
int PyC_AsArray(void *array, PyObject *value, const int length, const PyTypeObject *type, const short is_double, const char *error_prefix);
|
||||
|
||||
|
Reference in New Issue
Block a user