diff options
author | R David Murray <rdmurray@bitdance.com> | 2011-03-14 21:14:53 -0400 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2011-03-14 21:14:53 -0400 |
commit | eba3adb8c547317bb259a27be2dc6b0af2f467af (patch) | |
tree | 2fd1b6de9a90d37d2c473ad5ef9df7fe0cbdb70e /Python/getargs.c | |
parent | 645f312bebd576c855073c4ecc06a0673614f227 (diff) | |
parent | 36d507533d39b10591431beb91102e5da812d07b (diff) | |
download | cpython-eba3adb8c547317bb259a27be2dc6b0af2f467af.tar.gz |
Merge long Japanese header fix from 3.2.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 600941d9c7..e1cef0cc58 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -551,7 +551,7 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, #define UNICODE_DEFAULT_ENCODING(arg) \ - _PyUnicode_AsDefaultEncodedString(arg, NULL) + _PyUnicode_AsDefaultEncodedString(arg) /* Format an error message generated by convertsimple(). */ @@ -966,9 +966,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, case 'u': /* raw unicode buffer (Py_UNICODE *) */ case 'Z': /* raw unicode buffer or None */ { + Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); + if (*format == '#') { /* any buffer-like object */ /* "s#" or "Z#" */ - Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); FETCH_SIZE; if (c == 'Z' && arg == Py_None) { @@ -984,8 +985,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, format++; } else { /* "s" or "Z" */ - Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); - if (c == 'Z' && arg == Py_None) *p = NULL; else if (PyUnicode_Check(arg)) { |