Skip to content

Commit 27f204d

Browse files
committed
Keep py3k and trunk code in sync.
1 parent 24cc78a commit 27f204d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/stringlib/formatter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,12 @@ format_float_internal(PyObject *value,
934934

935935
if (precision < 0)
936936
precision = 6;
937+
938+
#if PY_VERSION_HEX < 0x03010000
939+
/* 3.1 no longer converts large 'f' to 'g'. */
937940
if ((type == 'f' || type == 'F') && fabs(val) >= 1e50)
938941
type = 'g';
942+
#endif
939943

940944
/* Cast "type", because if we're in unicode we need to pass a
941945
8-bit char. This is safe, because we've restricted what "type"

0 commit comments

Comments
 (0)