mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Move assertion inside _PyTime_ObjectToTimeval()
Change also _PyTime_FromSeconds() assertion to ensure that the _PyTime_t type is used.
This commit is contained in:
parent
53e137c8dd
commit
bbdda21a7a
2 changed files with 14 additions and 7 deletions
|
|
@ -4100,7 +4100,6 @@ datetime_from_timestamp(PyObject *cls, TM_FUNC f, PyObject *timestamp,
|
|||
if (_PyTime_ObjectToTimeval(timestamp,
|
||||
&timet, &us, _PyTime_ROUND_FLOOR) == -1)
|
||||
return NULL;
|
||||
assert(0 <= us && us <= 999999);
|
||||
|
||||
return datetime_from_timet_and_us(cls, f, timet, (int)us, tzinfo);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue