summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/formatter.h
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringlib/formatter.h')
-rw-r--r--Objects/stringlib/formatter.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h
index e8e83f4..3ca14fa 100644
--- a/Objects/stringlib/formatter.h
+++ b/Objects/stringlib/formatter.h
@@ -925,11 +925,16 @@ FORMAT_FLOAT(PyObject *value, PyObject *args)
}
/* parse the format_spec */
- if (!parse_internal_render_format_spec(format_spec, &format, 'g'))
+ if (!parse_internal_render_format_spec(format_spec, &format, '\0'))
goto done;
/* type conversion? */
switch (format.type) {
+ case '\0':
+ /* 'Z' means like 'g', but with at least one decimal. See
+ PyOS_ascii_formatd */
+ format.type = 'Z';
+ /* Deliberate fall through to the next case statement */
case 'e':
case 'E':
case 'f':