mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
Issue #14127: Add st_{cma}time_ns fields to os.stat() result object.
This commit is contained in:
parent
dd5aa36f17
commit
6fe20b3aee
6 changed files with 96 additions and 33 deletions
|
@ -96,6 +96,17 @@ _PyLong_AsTime_t(PyObject *obj)
|
|||
return (time_t)val;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
_PyLong_FromTime_t(time_t t)
|
||||
{
|
||||
#if defined(HAVE_LONG_LONG) && SIZEOF_TIME_T == SIZEOF_LONG_LONG
|
||||
return PyLong_FromLongLong((PY_LONG_LONG)t);
|
||||
#else
|
||||
assert(sizeof(time_t) <= sizeof(long));
|
||||
return PyLong_FromLong((long)t);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
_PyTime_ObjectToDenominator(PyObject *obj, time_t *sec, long *numerator,
|
||||
double denominator)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue