mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Backed out changeset b690bf218702
Issue #23517: the change broke test_datetime. datetime.timedelta() rounding mode must also be changed, and test_datetime must be updated for the new rounding mode (half up).
This commit is contained in:
parent
265e1259e4
commit
a53ec7a91a
2 changed files with 1 additions and 6 deletions
|
@ -17,11 +17,6 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
- Issue #23517: datetime.datetime.fromtimestamp() and
|
|
||||||
datetime.datetime.utcfromtimestamp() now rounds to nearest with ties going
|
|
||||||
away from zero, instead of rounding towards minus infinity (-inf), as Python
|
|
||||||
2 and Python older than 3.3.
|
|
||||||
|
|
||||||
- Issue #23552: Timeit now warns when there is substantial (4x) variance
|
- Issue #23552: Timeit now warns when there is substantial (4x) variance
|
||||||
between best and worst times. Patch from Serhiy Storchaka.
|
between best and worst times. Patch from Serhiy Storchaka.
|
||||||
|
|
||||||
|
|
|
@ -4098,7 +4098,7 @@ datetime_from_timestamp(PyObject *cls, TM_FUNC f, PyObject *timestamp,
|
||||||
long us;
|
long us;
|
||||||
|
|
||||||
if (_PyTime_ObjectToTimeval(timestamp,
|
if (_PyTime_ObjectToTimeval(timestamp,
|
||||||
&timet, &us, _PyTime_ROUND_HALF_UP) == -1)
|
&timet, &us, _PyTime_ROUND_FLOOR) == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return datetime_from_timet_and_us(cls, f, timet, (int)us, tzinfo);
|
return datetime_from_timet_and_us(cls, f, timet, (int)us, tzinfo);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue