diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-17 12:06:44 +0200 |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-17 12:06:44 +0200 |
| commit | 444b8a182b5a690fdb3e4d28ca8a61de27949178 (patch) | |
| tree | ba0f608b985a89c2a4baee4bc0e07cb461443092 /Python/formatter_unicode.c | |
| parent | f31fbd0341e56d6d7f729688befbc0edc9379802 (diff) | |
| parent | aa3eafec628637ab0369d1268934eb6201cf32d1 (diff) | |
| download | cpython-444b8a182b5a690fdb3e4d28ca8a61de27949178.tar.gz | |
Merge rephrasing with 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); } |
