diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-18 14:06:54 +0200 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-18 14:06:54 +0200 |
commit | 23e41c9686435a8a01da7fead079c783087ee5c5 (patch) | |
tree | 0593cf00b74bcabb8cb52c2108750c2f80fa2c81 /Python/formatter_unicode.c | |
parent | 68a2b84e68c3fe3abaa1bae589e17bfbb13461c2 (diff) | |
parent | e93555d91c4608e06e3058a42af0f2450c9dfd19 (diff) | |
download | cpython-23e41c9686435a8a01da7fead079c783087ee5c5.tar.gz |
#16306: 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); } |