diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-05-29 10:30:29 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-05-29 10:30:29 (GMT) |
commit | a1b0c9fc4d68cd4e1103456d0cedf2ef3bbbfe9a (patch) | |
tree | 84acf7bd4b0a53913f727315d4f4b4e4324c4ae5 /Python | |
parent | 87ea780e8ef029dd877dda18f5d0bc8983766848 (diff) | |
download | cpython-a1b0c9fc4d68cd4e1103456d0cedf2ef3bbbfe9a.zip cpython-a1b0c9fc4d68cd4e1103456d0cedf2ef3bbbfe9a.tar.gz cpython-a1b0c9fc4d68cd4e1103456d0cedf2ef3bbbfe9a.tar.bz2 |
PyArg_Parse*("U"): ensure that the Unicode string is ready
Diffstat (limited to 'Python')
-rw-r--r-- | Python/getargs.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ 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; |