From 438106b66ef4d65746ddecfee3441eb4e20e679b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 2 May 2012 00:41:57 +0200 Subject: Issue #14687: Cleanup PyUnicode_Format() --- Objects/unicodeobject.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 95993e8..1d85d5b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -13719,7 +13719,8 @@ PyUnicode_Format(PyObject *format, PyObject *args) PyObject *signobj = NULL, *fillobj = NULL; fmtpos++; - if (PyUnicode_READ(fmtkind, fmt, fmtpos) == '(') { + c = PyUnicode_READ(fmtkind, fmt, fmtpos); + if (c == '(') { Py_ssize_t keystart; Py_ssize_t keylen; PyObject *key; @@ -13765,7 +13766,8 @@ PyUnicode_Format(PyObject *format, PyObject *args) argidx = -2; } while (--fmtcnt >= 0) { - switch (c = PyUnicode_READ(fmtkind, fmt, fmtpos++)) { + c = PyUnicode_READ(fmtkind, fmt, fmtpos++); + switch (c) { case '-': flags |= F_LJUST; continue; case '+': flags |= F_SIGN; continue; case ' ': flags |= F_BLANK; continue; -- cgit v0.12