Issue #19437: Fix datetime_subtract(), handle new_delta() failure
This commit is contained in:
parent
aa5bbfaa77
commit
70e11acdbd
|
@ -4462,6 +4462,9 @@ datetime_subtract(PyObject *left, PyObject *right)
|
||||||
delta_us = DATE_GET_MICROSECOND(left) -
|
delta_us = DATE_GET_MICROSECOND(left) -
|
||||||
DATE_GET_MICROSECOND(right);
|
DATE_GET_MICROSECOND(right);
|
||||||
result = new_delta(delta_d, delta_s, delta_us, 1);
|
result = new_delta(delta_d, delta_s, delta_us, 1);
|
||||||
|
if (result == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (offdiff != NULL) {
|
if (offdiff != NULL) {
|
||||||
PyObject *temp = result;
|
PyObject *temp = result;
|
||||||
result = delta_subtract(result, offdiff);
|
result = delta_subtract(result, offdiff);
|
||||||
|
|
Loading…
Reference in New Issue