@@ -28,16 +28,17 @@ unknown_presentation_type(Py_UCS4 presentation_type,
2828}
2929
3030static void
31- invalid_comma_type ( Py_UCS4 presentation_type )
31+ invalid_thousands_separator_type ( char specifier , Py_UCS4 presentation_type )
3232{
33+ assert (specifier == ',' || specifier == '_' );
3334 if (presentation_type > 32 && presentation_type < 128 )
3435 PyErr_Format (PyExc_ValueError ,
35- "Cannot specify ', ' with '%c'." ,
36- (char )presentation_type );
36+ "Cannot specify '%c ' with '%c'." ,
37+ specifier , (char )presentation_type );
3738 else
3839 PyErr_Format (PyExc_ValueError ,
39- "Cannot specify ', ' with '\\x%x'." ,
40- (unsigned int )presentation_type );
40+ "Cannot specify '%c ' with '\\x%x'." ,
41+ specifier , (unsigned int )presentation_type );
4142}
4243
4344static void
@@ -117,8 +118,8 @@ is_sign_element(Py_UCS4 c)
117118/* Locale type codes. LT_NO_LOCALE must be zero. */
118119enum LocaleType {
119120 LT_NO_LOCALE = 0 ,
120- LT_DEFAULT_LOCALE ,
121- LT_UNDERSCORE_LOCALE ,
121+ LT_DEFAULT_LOCALE = ',' ,
122+ LT_UNDERSCORE_LOCALE = '_' ,
122123 LT_UNDER_FOUR_LOCALE ,
123124 LT_CURRENT_LOCALE
124125};
@@ -314,7 +315,7 @@ parse_internal_render_format_spec(PyObject *format_spec,
314315 }
315316 /* fall through */
316317 default :
317- invalid_comma_type ( format -> type );
318+ invalid_thousands_separator_type ( format -> thousands_separators , format -> type );
318319 return 0 ;
319320 }
320321 }
0 commit comments