Issue #22117: Fix rounding in _PyTime_FromSecondsObject()
* Rename _PyTime_FromObject() to _PyTime_FromSecondsObject()
* Add _PyTime_AsNanosecondsObject() and _testcapi.pytime_fromsecondsobject()
* Add unit tests
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index e44e082..1ce2f6a 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -221,7 +221,7 @@
time_sleep(PyObject *self, PyObject *obj)
{
_PyTime_t secs;
- if (_PyTime_FromObject(&secs, obj, _PyTime_ROUND_UP))
+ if (_PyTime_FromSecondsObject(&secs, obj, _PyTime_ROUND_UP))
return NULL;
if (secs < 0) {
PyErr_SetString(PyExc_ValueError,