summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2013-03-16 02:52:24 -0400
committerTerry Jan Reedy <tjreedy@udel.edu>2013-03-16 02:52:24 -0400
commitddf47eb8c61ed4d3ee3ec680336b016b627e53dd (patch)
tree7c238ff29a60d4957e6e26d336a6163f061d057d /Python/formatter_unicode.c
parentf612c8fa7c1d6e244200a3eff0a82abcca4cca82 (diff)
parentcdfac6f16bec10dcb4885fd7f74ae80884d0cdf1 (diff)
downloadcpython-ddf47eb8c61ed4d3ee3ec680336b016b627e53dd.tar.gz
Merge 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 17eb9789e0..79fa469697 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);
}