summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-01-25 09:56:33 (GMT)
committerGitHub <noreply@github.com>2021-01-25 09:56:33 (GMT)
commitcf19cc3b920ca5995e1c202d2c3dd7a59ac8eac8 (patch)
tree114c6f03de6e732ca7b81bd60d48b1a7f7968b33 /Python
parent8dfe15625e6ea4357a13fec7989a0e6ba2bf1359 (diff)
downloadcpython-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.c2
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;