summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-17 12:06:44 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-17 12:06:44 +0200
commit444b8a182b5a690fdb3e4d28ca8a61de27949178 (patch)
treeba0f608b985a89c2a4baee4bc0e07cb461443092 /Python/formatter_unicode.c
parentf31fbd0341e56d6d7f729688befbc0edc9379802 (diff)
parentaa3eafec628637ab0369d1268934eb6201cf32d1 (diff)
downloadcpython-444b8a182b5a690fdb3e4d28ca8a61de27949178.tar.gz
Merge rephrasing with 3.3.
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r--Python/formatter_unicode.c3
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);
}