summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2015-03-27 16:57:16 (GMT)
committerBrett Cannon <brett@python.org>2015-03-27 16:57:16 (GMT)
commitff7f428b38d22e1a168fff3f9eac383e8e5511f5 (patch)
tree82ad850a2c0eaefa85db8d92a29b38469db7c442 /Modules/_testcapimodule.c
parent781692ff6af7747948b956eca9b435c9c93c3407 (diff)
parent992c43fec900e204deffc026318b97ab0f83eff6 (diff)
downloadcpython-ff7f428b38d22e1a168fff3f9eac383e8e5511f5.zip
cpython-ff7f428b38d22e1a168fff3f9eac383e8e5511f5.tar.gz
cpython-ff7f428b38d22e1a168fff3f9eac383e8e5511f5.tar.bz2
Merge
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index b8e1dbc..ec513bc 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -3378,6 +3378,22 @@ return_result_with_error(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
+static PyObject *
+test_pytime_fromsecondsobject(PyObject *self, PyObject *args)
+{
+ PyObject *obj;
+ int round;
+ _PyTime_t ts;
+
+ if (!PyArg_ParseTuple(args, "Oi", &obj, &round))
+ return NULL;
+ if (check_time_rounding(round) < 0)
+ return NULL;
+ if (_PyTime_FromSecondsObject(&ts, obj, round) == -1)
+ return NULL;
+ return _PyTime_AsNanosecondsObject(ts);
+}
+
static PyMethodDef TestMethods[] = {
{"raise_exception", raise_exception, METH_VARARGS},
@@ -3541,6 +3557,7 @@ static PyMethodDef TestMethods[] = {
return_null_without_error, METH_NOARGS},
{"return_result_with_error",
return_result_with_error, METH_NOARGS},
+ {"pytime_fromsecondsobject", test_pytime_fromsecondsobject, METH_VARARGS},
{NULL, NULL} /* sentinel */
};