@@ -28,16 +28,17 @@ unknown_presentation_type(Py_UCS4 presentation_type,
28
28
}
29
29
30
30
static void
31
- invalid_comma_type ( Py_UCS4 presentation_type )
31
+ invalid_thousands_separator_type ( char specifier , Py_UCS4 presentation_type )
32
32
{
33
+ assert (specifier == ',' || specifier == '_' );
33
34
if (presentation_type > 32 && presentation_type < 128 )
34
35
PyErr_Format (PyExc_ValueError ,
35
- "Cannot specify ', ' with '%c'." ,
36
- (char )presentation_type );
36
+ "Cannot specify '%c ' with '%c'." ,
37
+ specifier , (char )presentation_type );
37
38
else
38
39
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 );
41
42
}
42
43
43
44
static void
@@ -117,8 +118,8 @@ is_sign_element(Py_UCS4 c)
117
118
/* Locale type codes. LT_NO_LOCALE must be zero. */
118
119
enum LocaleType {
119
120
LT_NO_LOCALE = 0 ,
120
- LT_DEFAULT_LOCALE ,
121
- LT_UNDERSCORE_LOCALE ,
121
+ LT_DEFAULT_LOCALE = ',' ,
122
+ LT_UNDERSCORE_LOCALE = '_' ,
122
123
LT_UNDER_FOUR_LOCALE ,
123
124
LT_CURRENT_LOCALE
124
125
};
@@ -314,7 +315,7 @@ parse_internal_render_format_spec(PyObject *format_spec,
314
315
}
315
316
/* fall through */
316
317
default :
317
- invalid_comma_type ( format -> type );
318
+ invalid_thousands_separator_type ( format -> thousands_separators , format -> type );
318
319
return 0 ;
319
320
}
320
321
}
0 commit comments