diff options
author | han-solo <hanish0019@gmail.com> | 2020-09-01 14:34:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 14:34:29 (GMT) |
commit | 0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35 (patch) | |
tree | 514106377b382e93d955fedc230dcc6e3a36cfff /Python/formatter_unicode.c | |
parent | f5a16b4dbf62cb9b48c42098bd5a8cfa665456c3 (diff) | |
download | cpython-0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35.zip cpython-0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35.tar.gz cpython-0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35.tar.bz2 |
bpo-41681: Fix for `f-string/str.format` error description when using 2 `,` in format specifier (GH-22036)
* Fixed `f-string/str.format` error description when using two `,` in format specifier.
Co-authored-by: millefalcon <hanish0019@hmail.com>
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r-- | Python/formatter_unicode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 74638ca..ed95f26 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -252,8 +252,10 @@ parse_internal_render_format_spec(PyObject *format_spec, ++pos; } if (end-pos && READ_spec(pos) == ',') { - invalid_comma_and_underscore(); - return 0; + if (format->thousands_separators == LT_UNDERSCORE_LOCALE) { + invalid_comma_and_underscore(); + return 0; + } } /* Parse field precision */ |