mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show repr of non-unicode object in ICU errors
This commit is contained in:
parent
1f7a80cdd3
commit
548065f29e
@ -35,7 +35,7 @@ static UChar* python_to_icu(PyObject *obj, int32_t *osz) {
|
||||
int i;
|
||||
|
||||
if (!PyUnicode_CheckExact(obj)) {
|
||||
PyErr_SetString(PyExc_TypeError, "Not a unicode string");
|
||||
PyErr_Format(PyExc_TypeError, "%R is not a unicode string", obj);
|
||||
return NULL;
|
||||
}
|
||||
if(PyUnicode_READY(obj) == -1) {
|
||||
@ -105,7 +105,7 @@ static UChar32* python_to_icu32(PyObject *obj, int32_t *osz) {
|
||||
int i;
|
||||
|
||||
if (!PyUnicode_CheckExact(obj)) {
|
||||
PyErr_SetString(PyExc_TypeError, "Not a unicode string");
|
||||
PyErr_Format(PyExc_TypeError, "%R is not a unicode string", obj);
|
||||
return NULL;
|
||||
}
|
||||
if(PyUnicode_READY(obj) == -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user