diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2012-05-29 12:30:29 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2012-05-29 12:30:29 +0200 |
| commit | feb3a43fc0ee359f33e6657692287a42c14d6fc3 (patch) | |
| tree | 5ca14526b62751a648ddf69845218c08917f0283 /Python | |
| parent | 8d4b1ca672f75f0587a3a8a6973fd2438e485eae (diff) | |
| download | cpython-feb3a43fc0ee359f33e6657692287a42c14d6fc3.tar.gz | |
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 17c4ee5955..9f72fa4ebf 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; |
