Revert change 0eb8c182131e:
"""Issue #23517: datetime.timedelta constructor now rounds microseconds to
nearest with ties going away from zero (ROUND_HALF_UP), as Python 2 and Python
older than 3.3, instead of rounding to nearest with ties going to nearest even
integer (ROUND_HALF_EVEN)."""
datetime.timedelta uses rounding mode ROUND_HALF_EVEN again.
diff --git a/Lib/datetime.py b/Lib/datetime.py
index 6b2ac33..3c25ef8 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -407,7 +407,7 @@
# secondsfrac isn't referenced again
if isinstance(microseconds, float):
- microseconds = _round_half_up(microseconds + usdouble)
+ microseconds = round(microseconds + usdouble)
seconds, microseconds = divmod(microseconds, 1000000)
days, seconds = divmod(seconds, 24*3600)
d += days
@@ -418,7 +418,7 @@
days, seconds = divmod(seconds, 24*3600)
d += days
s += seconds
- microseconds = _round_half_up(microseconds + usdouble)
+ microseconds = round(microseconds + usdouble)
assert isinstance(s, int)
assert isinstance(microseconds, int)
assert abs(s) <= 3 * 24 * 3600