]> granicus.if.org Git - python/commitdiff
Another temporary checkin to diagnose test_float failure on 3.1 Ubuntu buildbot.
authorMark Dickinson <dickinsm@gmail.com>
Fri, 9 Jul 2010 20:10:37 +0000 (20:10 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Fri, 9 Jul 2010 20:10:37 +0000 (20:10 +0000)
Python/pystrtod.c

index 5fa51ebc9aaf12292d1f979ef47e114cc0a0f2dd..0dea0a6e95de2b4f3447dbbe19918bd632a4d888 100644 (file)
@@ -1001,9 +1001,17 @@ format_float_short(double d, char format_code,
         else {
             /* shouldn't get here: Gay's code should always return
                something starting with a digit, an 'I',  or 'N' */
-            strncpy(p, "ERR", 3);
-            p += 3;
-            /* assert(0); */
+            printf("Unexpected failure in format_float_short. "
+                   "Arguments: d = %.17g, format_code = %d, "
+                   "mode = %d, precision = %ld\n",
+                   d, format_code, mode, precision);
+            printf("digits == %.100s\n", digits);
+            PyErr_Format(PyExc_RuntimeError,
+                         "Unexpected failure in format_float_short. "
+                         "Arguments: d = %.17g, format_code = %d, "
+                         "mode = %d, precision = %ld\n",
+                         d, format_code, mode, precision);
+            return NULL;
         }
         goto exit;
     }