diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2012-12-03 21:09:27 +0100 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-12-03 21:09:27 +0100 |
| commit | dca07911b29139fc1eef66cc366d0e0ead3b8853 (patch) | |
| tree | 84522a8ccb17f601f72993cbfe6cd4dda5bf5786 /Python/formatter_unicode.c | |
| parent | 6d19a84e20bd332bcc35385f3986865336e7ed02 (diff) | |
| parent | 3575597ccfa3f7a6cca57ee738198c4047a4cfce (diff) | |
| download | cpython-dca07911b29139fc1eef66cc366d0e0ead3b8853.tar.gz | |
Fix test splitting in previous commit.
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); } |
