Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 69798:509f1c15a1e1 2.7
Issue #8651: Fix "z#" format of PyArg_Parse*() function: the size was not
written if PY_SSIZE_T_CLEAN is defined.
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Tue, 03 May 2011 15:06:11 +0200 |
| parents | b36cb4602e21 |
| children | a0681e7a6ded |
line wrap: on
line diff
--- a/Python/getargs.c Tue May 03 14:36:36 2011 +0200 +++ b/Python/getargs.c Tue May 03 15:06:11 2011 +0200 @@ -984,10 +984,11 @@ 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 &&
