]> granicus.if.org Git - python/commitdiff
Sync trunk and py3k versions of string formatting. Will manually merge into py3k.
authorEric Smith <eric@trueblade.com>
Mon, 27 Jul 2009 01:58:25 +0000 (01:58 +0000)
committerEric Smith <eric@trueblade.com>
Mon, 27 Jul 2009 01:58:25 +0000 (01:58 +0000)
Objects/stringlib/formatter.h

index 3b2218128dd98e6589db0ffc15a5b7cd30f9c8d3..5cead660c4e2ecae18cca47f7366bf38d6f943ea 100644 (file)
@@ -920,9 +920,12 @@ format_float_internal(PyObject *value,
            format the result. We take care of that later. */
         type = 'g';
 
+#if PY_VERSION_HEX < 0x0301000
     /* 'F' is the same as 'f', per the PEP */
+    /* This is no longer the case in 3.x */
     if (type == 'F')
         type = 'f';
+#endif
 
     val = PyFloat_AsDouble(value);
     if (val == -1.0 && PyErr_Occurred())
@@ -1114,9 +1117,12 @@ format_complex_internal(PyObject *value,
            format the result. We take care of that later. */
         type = 'g';
 
+#if PY_VERSION_HEX < 0x03010000
+    /* This is no longer the case in 3.x */
     /* 'F' is the same as 'f', per the PEP */
     if (type == 'F')
         type = 'f';
+#endif
 
     if (precision < 0)
         precision = default_precision;