summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-28 04:02:39 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-28 04:02:39 (GMT)
commit02937aab13ecfe1f67b8de48c37412b0328217ec (patch)
treee6ae07581ca459a4b561f479d1610b2c5341fff2 /Modules/_testcapimodule.c
parentb3b454407058cd57d8a401a5aeb018d4ccb87616 (diff)
downloadcpython-02937aab13ecfe1f67b8de48c37412b0328217ec.zip
cpython-02937aab13ecfe1f67b8de48c37412b0328217ec.tar.gz
cpython-02937aab13ecfe1f67b8de48c37412b0328217ec.tar.bz2
Issue #22117: Add the new _PyTime_ROUND_FLOOR rounding method for the datetime
module. time.clock_settime() now uses this rounding method instead of _PyTime_ROUND_DOWN to handle correctly dates before 1970.
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 4503dc3..5c54ad6 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -2634,7 +2634,8 @@ run_in_subinterp(PyObject *self, PyObject *args)
static int
check_time_rounding(int round)
{
- if (round != _PyTime_ROUND_DOWN && round != _PyTime_ROUND_UP) {
+ if (round != _PyTime_ROUND_DOWN && round != _PyTime_ROUND_UP
+ && round != _PyTime_ROUND_FLOOR) {
PyErr_SetString(PyExc_ValueError, "invalid rounding");
return -1;
}