commit | 70e11acdbd3a206003dd47bbccc111ce1d55b88c | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@gmail.com> | Fri Nov 08 00:50:58 2013 +0100 |
committer | Victor Stinner <victor.stinner@gmail.com> | Fri Nov 08 00:50:58 2013 +0100 |
tree | 2cd9ce39cefc2972d1f74921a4a8b3f1ea738832 | |
parent | aa5bbfaa77a14634a035233a8879351d320bad6c [diff] |
Issue #19437: Fix datetime_subtract(), handle new_delta() failure
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index a89e0ec..1eace71 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c
@@ -4462,6 +4462,9 @@ 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);