[Python-checkins] r47096 - sandbox/trunk/decimal-c/_decimal.c

Neal Norwitz nnorwitz at gmail.com
Mon Jun 26 05:54:29 CEST 2006


> Modified: sandbox/trunk/decimal-c/_decimal.c
> ==============================================================================
> --- sandbox/trunk/decimal-c/_decimal.c  (original)
> +++ sandbox/trunk/decimal-c/_decimal.c  Mon Jun 26 04:52:11 2006
> @@ -1768,6 +1768,28 @@
>  }
>  DECIMAL_BINARY_FUNC(compare)
>
> +static int
> +decimal_cmp(decimalobject *self, decimalobject *other)
> +{
...
> +    res = _do_real_decimal_compare(self, other, ctx);
> +    Py_DECREF(other);
> +    if (PyErr_Occurred())
> +        return NULL;
> +
> +    return res;

Won't res be NULL if an error occurred?  If so, there's no reason for the if.

n


More information about the Python-checkins mailing list