diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-09-01 15:45:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 15:45:59 (GMT) |
commit | c16a2a1b643d3e04f86780e2c9e66c3f9f322560 (patch) | |
tree | 8d707bcefac61faf87fd7fd23a998c86421dba20 /Python/formatter_unicode.c | |
parent | ca55ecbf9aab305fa301ec69410ca3d3d18ec848 (diff) | |
download | cpython-c16a2a1b643d3e04f86780e2c9e66c3f9f322560.zip cpython-c16a2a1b643d3e04f86780e2c9e66c3f9f322560.tar.gz cpython-c16a2a1b643d3e04f86780e2c9e66c3f9f322560.tar.bz2 |
bpo-41681: Fix for `f-string/str.format` error description when using 2 `,` in format specifier (GH-22036) (GH-22041)
* Fixed `f-string/str.format` error description when using two `,` in format specifier.
Co-authored-by: millefalcon <hanish0019@hmail.com>
(cherry picked from commit 0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35)
Co-authored-by: han-solo <hanish0019@gmail.com>
Co-authored-by: han-solo <hanish0019@gmail.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 */ |