diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-01-25 09:56:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-25 09:56:33 (GMT) |
commit | cf19cc3b920ca5995e1c202d2c3dd7a59ac8eac8 (patch) | |
tree | 114c6f03de6e732ca7b81bd60d48b1a7f7968b33 /Python | |
parent | 8dfe15625e6ea4357a13fec7989a0e6ba2bf1359 (diff) | |
download | cpython-cf19cc3b920ca5995e1c202d2c3dd7a59ac8eac8.zip cpython-cf19cc3b920ca5995e1c202d2c3dd7a59ac8eac8.tar.gz cpython-cf19cc3b920ca5995e1c202d2c3dd7a59ac8eac8.tar.bz2 |
bpo-27772: Make preceding width with 0 valid in string format. (GH-11270)
Previously it was an error with confusing error message.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/formatter_unicode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index ed95f26..5ccf9d3 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -219,7 +219,7 @@ parse_internal_render_format_spec(PyObject *format_spec, /* The special case for 0-padding (backwards compat) */ if (!fill_char_specified && end-pos >= 1 && READ_spec(pos) == '0') { format->fill_char = '0'; - if (!align_specified) { + if (!align_specified && default_align == '>') { format->align = '='; } ++pos; |