commit | a1b0c9fc4d68cd4e1103456d0cedf2ef3bbbfe9a | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@gmail.com> | Tue May 29 12:30:29 2012 +0200 |
committer | Victor Stinner <victor.stinner@gmail.com> | Tue May 29 12:30:29 2012 +0200 |
tree | 84acf7bd4b0a53913f727315d4f4b4e4324c4ae5 | |
parent | 87ea780e8ef029dd877dda18f5d0bc8983766848 [diff] [blame] |
PyArg_Parse*("U"): ensure that the Unicode string is ready
diff --git a/Python/getargs.c b/Python/getargs.c index 17c4ee5..9f72fa4 100644 --- a/Python/getargs.c +++ b/Python/getargs.c
@@ -1167,8 +1167,11 @@ 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;