Skip to content

Commit 250606a

Browse files
Return seconds from mod.initialized() instead of nanoseconds.
1 parent 285fcb9 commit 250606a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/test/test_imp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def check_common(name, module):
286286
# module.__name__ might not match, but the spec will.
287287
self.assertEqual(module.__spec__.name, name)
288288
if initialized is not None:
289-
self.assertIsInstance(initialized, int)
289+
self.assertIsInstance(initialized, float)
290290
self.assertGreater(initialized, 0)
291291
self.assertEqual(summed, 3)
292292
self.assertTrue(issubclass(module.error, Exception))

Modules/_testsinglephase.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ common_initialized(PyObject *self, PyObject *Py_UNUSED(ignored))
116116
if (state == NULL) {
117117
Py_RETURN_NONE;
118118
}
119-
return PyLong_FromLong(state->initialized);
119+
double d = _PyTime_AsSecondsDouble(state->initialized);
120+
return PyFloat_FromDouble(d);
120121
}
121122

122123
#define INITIALIZED_METHODDEF \

0 commit comments

Comments
 (0)