From 80d07f825108761af9fe2ac79c1ef50289c07c08 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 23 Apr 2012 10:55:29 -0400 Subject: inherit maxchar of field value where needed (closes #14648) --- Python/formatter_unicode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Python/formatter_unicode.c') diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 58e66e0d90..5e5b19f7fe 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -747,6 +747,9 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format) len = format->precision; } + if (len) + maxchar = PyUnicode_MAX_CHAR_VALUE(value); + calc_padding(len, format->width, format->align, &lpad, &rpad, &total); if (lpad != 0 || rpad != 0) -- cgit v1.2.1