Cleanup dangling reference in get_timezone_utc_capi (#5317)

This commit is contained in:
Paul Ganssle 2018-01-25 08:58:07 -05:00 committed by Victor Stinner
parent 2812d3d992
commit 58dc03c737
1 changed files with 2 additions and 0 deletions

View File

@ -2300,8 +2300,10 @@ get_timezone_utc_capi(PyObject* self, PyObject *args) {
return NULL;
}
if (macro) {
Py_INCREF(PyDateTime_TimeZone_UTC);
return PyDateTime_TimeZone_UTC;
} else {
Py_INCREF(PyDateTimeAPI->TimeZone_UTC);
return PyDateTimeAPI->TimeZone_UTC;
}
}