summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/formatter_unicode.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index 5ccf9d3..7b5a7bd 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -773,8 +773,14 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format,
/* sign is not allowed on strings */
if (format->sign != '\0') {
- PyErr_SetString(PyExc_ValueError,
- "Sign not allowed in string format specifier");
+ if (format->sign == ' ') {
+ PyErr_SetString(PyExc_ValueError,
+ "Space not allowed in string format specifier");
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "Sign not allowed in string format specifier");
+ }
goto done;
}