diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2012-10-05 00:37:11 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2012-10-05 00:37:11 +0200 |
| commit | 48902eec54451a2603335a564394fe2b5a1906b2 (patch) | |
| tree | 7638ce8f585d408167082a4f6ebe4f65bb5a034d /Python/formatter_unicode.c | |
| parent | f016e8814fb6c18330119f38c8cb848aac57363d (diff) | |
| parent | 65f9af1b8cadf83a3a627404b4ff5158d43d6994 (diff) | |
| download | cpython-48902eec54451a2603335a564394fe2b5a1906b2.tar.gz | |
merge 3.3 (bug already fixed, differently, in default)
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); } |
