diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-12-14 20:20:07 +0200 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-12-14 20:20:07 +0200 |
commit | a8a775c5161d12a9d21569743f13a30ab3946d1c (patch) | |
tree | 08480d953d58e6a09caa9c5ad8e1b281c577ac59 /Python/formatter_unicode.c | |
parent | 5053cae50d42238871c49371a328d7686f7eb13d (diff) | |
parent | 13321a29888234527e6ac1b798856a3ac47fcbd2 (diff) | |
download | cpython-a8a775c5161d12a9d21569743f13a30ab3946d1c.tar.gz |
#16683: merge with 3.3.
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r-- | Python/formatter_unicode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index aa62502dbe..0ce9862a20 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -757,7 +757,8 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format, goto done; } - if (format->width == -1 && format->precision == -1) { + if ((format->width == -1 || format->width <= len) + && (format->precision == -1 || format->precision >= len)) { /* Fast path */ return _PyUnicodeWriter_WriteStr(writer, value); } |