diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-03 15:06:11 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-03 15:06:11 +0200 |
commit | 645b9f67aef1f6c8921cf5f8bbe6db3fa94418bc (patch) | |
tree | e421b455913218835cea1cd50f1156d43d603f4e /Python | |
parent | 112d48ac17647879fffa5275dd31dca8bfb3223b (diff) | |
download | cpython-git-645b9f67aef1f6c8921cf5f8bbe6db3fa94418bc.tar.gz |
Issue #8651: Fix "z#" format of PyArg_Parse*() function: the size was not
written if PY_SSIZE_T_CLEAN is defined.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/getargs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 7c3e9fa384..02351ed6fa 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -984,10 +984,11 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, if (*format == '#') { FETCH_SIZE; assert(0); /* XXX redundant with if-case */ - if (arg == Py_None) - *q = 0; - else - *q = PyString_Size(arg); + if (arg == Py_None) { + STORE_SIZE(0); + } else { + STORE_SIZE(PyString_Size(arg)); + } format++; } else if (*p != NULL && |