[Python-checkins] r80819 - python/trunk/Python/pystrtod.c
Eric Smith
eric at trueblade.com
Thu May 6 01:16:42 CEST 2010
Nick Coghlan wrote:
> brett.cannon wrote:
>> Modified: python/trunk/Python/pystrtod.c
>> ==============================================================================
>> --- python/trunk/Python/pystrtod.c (original)
>> +++ python/trunk/Python/pystrtod.c Wed May 5 22:35:24 2010
>> @@ -1005,7 +1005,6 @@
>> /* 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);
>> }
>> goto exit;
>
> I agree with Eric that this should be kept. (And possibly switched to
> Py_FatalError rather than using assert(), but I would need to look at
> the surrounding code to be sure about that)
I think it should stay an assert. This is a "we should never get here"
situation, but if we do, we format the float as "ERR" (as a sort-of
parallel to "NAN" and "INF") and keep going. I think that's better than
an unexpected failure.
Eric.
More information about the Python-checkins
mailing list