diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-05-01 22:41:57 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-05-01 22:41:57 (GMT) |
commit | 438106b66ef4d65746ddecfee3441eb4e20e679b (patch) | |
tree | 6e1902b37555bc91049620a5e10801b011039740 /Objects | |
parent | b5c3ea3af35e1b55079ac8018e52935f3a43d032 (diff) | |
download | cpython-438106b66ef4d65746ddecfee3441eb4e20e679b.zip cpython-438106b66ef4d65746ddecfee3441eb4e20e679b.tar.gz cpython-438106b66ef4d65746ddecfee3441eb4e20e679b.tar.bz2 |
Issue #14687: Cleanup PyUnicode_Format()
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 6 |
1 files 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; |