diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-11-12 16:48:25 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-11-12 16:48:25 -0500 |
commit | 9845da8acd3a38eabc247666f9968d3db78a7bdc (patch) | |
tree | 09badcc5e6d41892fb97db0ff41c5760fa000fe8 /Python/formatter_unicode.c | |
parent | 79b2bfe430a7ab9493f737ce2eddb080170dd0e5 (diff) | |
parent | cabe5e76cfca05fc7dc4b67c252af57ce8d74474 (diff) | |
download | cpython-9845da8acd3a38eabc247666f9968d3db78a7bdc.tar.gz |
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 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); } |