diff options
author | Raymond Hettinger <python@rcn.com> | 2013-03-24 15:21:57 -0700 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-03-24 15:21:57 -0700 |
commit | 579084247b8b12d2d8ec3faa98ae60e7bd5dcfab (patch) | |
tree | 30c07db6430d8d82091a73757b4194cd6d6328a7 /Python/formatter_unicode.c | |
parent | bbca631b3d681c2c81534d14e9bb746c3bb7c92b (diff) | |
parent | 86b17240c2e8176ba8ef55e39bf3b7d10914d8e4 (diff) | |
download | cpython-579084247b8b12d2d8ec3faa98ae60e7bd5dcfab.tar.gz |
merge
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 17eb9789e0..79fa469697 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); } |