Skip to content

Commit

Permalink
Cleanup dangling reference in get_timezone_utc_capi (python#5317)
Browse files Browse the repository at this point in the history
  • Loading branch information
pganssle authored and vstinner committed Jan 25, 2018
1 parent 2812d3d commit 58dc03c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 58dc03c

Please sign in to comment.