diff options
| author | Mark Dickinson <mdickinson@enthought.com> | 2012-11-25 14:37:43 +0000 |
|---|---|---|
| committer | Mark Dickinson <mdickinson@enthought.com> | 2012-11-25 14:37:43 +0000 |
| commit | cb878352fec4111a2b5490e12d2df9c4cae45579 (patch) | |
| tree | a2d21729b4a3870889cfcd56a571efa0aa1572dd /Python/formatter_unicode.c | |
| parent | 5cd62b7fe17e8004a4f137cf9164e4e71bb1bd70 (diff) | |
| parent | 9770925980a2c52aadd6aa1a6f3c243f9a62bae9 (diff) | |
| download | cpython-cb878352fec4111a2b5490e12d2df9c4cae45579.tar.gz | |
Issue #16546: merge fix from 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); } |
