Browse Source

PyArg_Parse*("U"): ensure that the Unicode string is ready

pull/2332/head
Victor Stinner 14 years ago
parent
commit
a1b0c9fc4d
  1. 5
      Python/getargs.c

5
Python/getargs.c

@ -1167,8 +1167,11 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
case 'U': { /* PyUnicode object */
PyObject **p = va_arg(*p_va, PyObject **);
if (PyUnicode_Check(arg))
if (PyUnicode_Check(arg)) {
if (PyUnicode_READY(arg) == -1)
RETURN_ERR_OCCURRED;
*p = arg;
}
else
return converterr("str", arg, msgbuf, bufsize);
break;

Loading…
Cancel
Save