diff options
author | Martin v. L?wis <martin@v.loewis.de> | 2013-03-24 22:53:04 +0100 |
---|---|---|
committer | Martin v. L?wis <martin@v.loewis.de> | 2013-03-24 22:53:04 +0100 |
commit | 86b17240c2e8176ba8ef55e39bf3b7d10914d8e4 (patch) | |
tree | a36b8eedc2ff4e94d7492eebbdcb989abf470142 /Python/formatter_unicode.c | |
parent | ce0764defba3da9c96a5e9f8badc848e1805baad (diff) | |
parent | 650458ab36c29cfd3906f4940eabd01b8b523b5c (diff) | |
download | cpython-86b17240c2e8176ba8ef55e39bf3b7d10914d8e4.tar.gz |
#17425: merge 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 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); } |