Skip to content

Commit e94a826

Browse files
committed
Sync trunk and py3k versions of string formatting. Will manually merge into py3k.
1 parent fb0e057 commit e94a826

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Objects/stringlib/formatter.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,9 +920,12 @@ format_float_internal(PyObject *value,
920920
format the result. We take care of that later. */
921921
type = 'g';
922922

923+
#if PY_VERSION_HEX < 0x0301000
923924
/* 'F' is the same as 'f', per the PEP */
925+
/* This is no longer the case in 3.x */
924926
if (type == 'F')
925927
type = 'f';
928+
#endif
926929

927930
val = PyFloat_AsDouble(value);
928931
if (val == -1.0 && PyErr_Occurred())
@@ -1114,9 +1117,12 @@ format_complex_internal(PyObject *value,
11141117
format the result. We take care of that later. */
11151118
type = 'g';
11161119

1120+
#if PY_VERSION_HEX < 0x03010000
1121+
/* This is no longer the case in 3.x */
11171122
/* 'F' is the same as 'f', per the PEP */
11181123
if (type == 'F')
11191124
type = 'f';
1125+
#endif
11201126

11211127
if (precision < 0)
11221128
precision = default_precision;

0 commit comments

Comments
 (0)