summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-03 21:36:22 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-03 21:36:22 +0200
commit46f36c8eeef40dc1b68be5514ed8b52c14c374a2 (patch)
tree5ae69bbff352be6084384242297ee677b4eec5b3 /Python/formatter_unicode.c
parent1a60c7a058d2b7cb5d844845e32376cef0c9b8f9 (diff)
parent9653e7ac7f1e6ca106848def3bd3f0a59e349d10 (diff)
downloadcpython-46f36c8eeef40dc1b68be5514ed8b52c14c374a2.tar.gz
Merge typo fixes (and the fix for #8401 that I wrongly merged) 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);
}