python string conversion

- use _PyUnicode_AsStringAndSize where possible
- use %R for PyErr_Format(...) rather then running repr on the object explicitly 
- use const char
This commit is contained in:
2011-11-03 14:09:18 +00:00
parent d210703bca
commit 665f602f15
14 changed files with 55 additions and 46 deletions

View File

@@ -1211,7 +1211,7 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix
if (!srna) {
if (PyErr_Occurred()) {
PyObject *msg= PyC_ExceptionBuffer();
char *msg_char= _PyUnicode_AsString(msg);
const char *msg_char= _PyUnicode_AsString(msg);
PyErr_Format(PyExc_TypeError,
"%.200s expected an RNA type derived from PropertyGroup, failed with: %s",
error_prefix, msg_char);