diff options
| author | Nick Coghlan <ncoghlan@gmail.com> | 2012-10-19 23:36:15 +1000 |
|---|---|---|
| committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-10-19 23:36:15 +1000 |
| commit | e62e25c41035e872f815f56b85bb856ade0e7f16 (patch) | |
| tree | 72492c177760c63869dc5c254e192d83b1e76da0 /Python/formatter_unicode.c | |
| parent | 0e5a2d4d40af5a4bcf79b8130971bf811c8e7d16 (diff) | |
| parent | 85cc7ca3a252bf6de12f0078963d99f52ce0f3df (diff) | |
| download | cpython-e62e25c41035e872f815f56b85bb856ade0e7f16.tar.gz | |
Merge fix from #6074 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); } |
