test_unicode
-* <built-in method join of unicode object at 0x81b3ba0> u' ' <class exceptions.TypeError at 0x80fac4c> u'7 hello 123'
Testing Unicode comparisons... done.
Testing Unicode contains method... done.
Testing Unicode formatting strings... done.
}
if (!PyUnicode_Check(item)) {
PyObject *v;
+ if (!PyString_Check(item)) {
+ PyErr_Format(PyExc_TypeError,
+ "sequence item %i: expected string or Unicode,"
+ " %.80s found",
+ i, item->ob_type->tp_name);
+ Py_DECREF(item);
+ goto onError;
+ }
v = PyUnicode_FromObject(item);
Py_DECREF(item);
item = v;
}
itemlen = PyUnicode_GET_SIZE(item);
while (reslen + itemlen + seplen >= sz) {
- if (_PyUnicode_Resize(&res, sz*2))
+ if (_PyUnicode_Resize(&res, sz*2)) {
+ Py_DECREF(item);
goto onError;
+ }
sz *= 2;
p = PyUnicode_AS_UNICODE(res) + reslen;
}