diff options
| author | Benjamin Peterson <benjamin@python.org> | 2012-10-31 19:01:48 -0400 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2012-10-31 19:01:48 -0400 |
| commit | 7bcea02a3ec67d76ddd9e420747ba4154b5650ef (patch) | |
| tree | b130765e008ec99d6187906ce2ede20b0903a8a5 /Python/formatter_unicode.c | |
| parent | 8144eb153a29e607aa5ee1957e1723557f605ae6 (diff) | |
| parent | 2cbd5aa7a912ac7ab3953cea26707b77df3b5dca (diff) | |
| download | cpython-7bcea02a3ec67d76ddd9e420747ba4154b5650ef.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); } |
