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>
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 @@
++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 */