mirror of https://github.com/python/cpython
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) -
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue