diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-10 12:24:06 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-10 12:24:06 +0200 |
commit | b269ef065938e598ab8bd99f73306aa7883e4257 (patch) | |
tree | 1bf6aeb4d1a83929b68c8d06b01bf8a434e8de03 /Python/formatter_unicode.c | |
parent | 82ad4d2a8d5b7b3147af9cf6406fca37d493e6ee (diff) | |
parent | 7dc68556d28f052d990549246963b63b4021ba4c (diff) | |
download | cpython-b269ef065938e598ab8bd99f73306aa7883e4257.tar.gz |
Issue #6975: os.path.realpath() now correctly resolves multiple nested symlinks on POSIX platforms.
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 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); } |