Skip to content

Commit

Permalink
pythongh-95878: Fix format char in datetime CAPI tests (pythonGH-95879)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran committed Aug 11, 2022
1 parent b4c857d commit 8b34e91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@ test_PyDateTime_GET(PyObject *self, PyObject *obj)
month = PyDateTime_GET_MONTH(obj);
day = PyDateTime_GET_DAY(obj);

return Py_BuildValue("(lll)", year, month, day);
return Py_BuildValue("(iii)", year, month, day);
}

static PyObject *
Expand All @@ -2452,7 +2452,7 @@ test_PyDateTime_DATE_GET(PyObject *self, PyObject *obj)
microsecond = PyDateTime_DATE_GET_MICROSECOND(obj);
PyObject *tzinfo = PyDateTime_DATE_GET_TZINFO(obj);

return Py_BuildValue("(llllO)", hour, minute, second, microsecond, tzinfo);
return Py_BuildValue("(iiiiO)", hour, minute, second, microsecond, tzinfo);
}

static PyObject *
Expand All @@ -2466,7 +2466,7 @@ test_PyDateTime_TIME_GET(PyObject *self, PyObject *obj)
microsecond = PyDateTime_TIME_GET_MICROSECOND(obj);
PyObject *tzinfo = PyDateTime_TIME_GET_TZINFO(obj);

return Py_BuildValue("(llllO)", hour, minute, second, microsecond, tzinfo);
return Py_BuildValue("(iiiiO)", hour, minute, second, microsecond, tzinfo);
}

static PyObject *
Expand All @@ -2478,7 +2478,7 @@ test_PyDateTime_DELTA_GET(PyObject *self, PyObject *obj)
seconds = PyDateTime_DELTA_GET_SECONDS(obj);
microseconds = PyDateTime_DELTA_GET_MICROSECONDS(obj);

return Py_BuildValue("(lll)", days, seconds, microseconds);
return Py_BuildValue("(iii)", days, seconds, microseconds);
}

/* test_thread_state spawns a thread of its own, and that thread releases
Expand Down

0 comments on commit 8b34e91

Please sign in to comment.