Cleanup dangling reference in get_timezone_utc_capi (#5317)
This commit is contained in:
parent
2812d3d992
commit
58dc03c737
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue