8000 Move Py_DECREF after PyErr_Format · python/cpython@9da0dfc · GitHub
[go: up one dir, main page]

Skip to content

Commit 9da0dfc

Browse files
committed
Move Py_DECREF after PyErr_Format
1 parent 4363e9e commit 9da0dfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,11 +1510,11 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
15101510
GET_TD_SECONDS(offset) == 0 &&
15111511
GET_TD_MICROSECONDS(offset) < 1) ||
15121512
GET_TD_DAYS(offset) < -1 || GET_TD_DAYS(offset) >= 1) {
1513-
Py_DECREF(offset);
15141513
PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
15151514
" strictly between -timedelta(hours=24) and"
15161515
" timedelta(hours=24),"
15171516
" not %R", offset);
1517+
Py_DECREF(offset);
15181518
return NULL;
15191519
}
15201520
}

0 commit comments

Comments
 (0)
0