diff options
Diffstat (limited to 'Modules/_testcapimodule.c')
| -rw-r--r-- | Modules/_testcapimodule.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 7b4f239637..d6eb6d4509 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -3383,6 +3383,18 @@ return_result_with_error(PyObject *self, PyObject *args) } static PyObject * +test_pytime_fromseconds(PyObject *self, PyObject *args) +{ + int seconds; + _PyTime_t ts; + + if (!PyArg_ParseTuple(args, "i", &seconds)) + return NULL; + ts = _PyTime_FromSeconds(seconds); + return _PyTime_AsNanosecondsObject(ts); +} + +static PyObject * test_pytime_fromsecondsobject(PyObject *self, PyObject *args) { PyObject *obj; @@ -3651,6 +3663,7 @@ static PyMethodDef TestMethods[] = { return_null_without_error, METH_NOARGS}, {"return_result_with_error", return_result_with_error, METH_NOARGS}, + {"PyTime_FromSeconds", test_pytime_fromseconds, METH_VARARGS}, {"PyTime_FromSecondsObject", test_pytime_fromsecondsobject, METH_VARARGS}, {"PyTime_AsSecondsDouble", test_pytime_assecondsdouble, METH_VARARGS}, {"PyTime_AsTimeval", test_PyTime_AsTimeval, METH_VARARGS}, |
