From: Victor Stinner Date: Thu, 7 Nov 2013 23:50:58 +0000 (+0100) Subject: Issue #19437: Fix datetime_subtract(), handle new_delta() failure X-Git-Tag: v3.4.0b1~339 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70e11acdbd3a206003dd47bbccc111ce1d55b88c;p=python Issue #19437: Fix datetime_subtract(), handle new_delta() failure --- diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index a89e0ecae5..1eace71f6a 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -4462,6 +4462,9 @@ datetime_subtract(PyObject *left, PyObject *right) delta_us = DATE_GET_MICROSECOND(left) - DATE_GET_MICROSECOND(right); result = new_delta(delta_d, delta_s, delta_us, 1); + if (result == NULL) + return NULL; + if (offdiff != NULL) { PyObject *temp = result; result = delta_subtract(result, offdiff);