Author: Brian Kearns <[email protected]>
Branch: py3k
Changeset: r62061:8d6f0f4e168b
Date: 2013-03-05 01:41 -0500
http://bitbucket.org/pypy/pypy/changeset/8d6f0f4e168b/

Log:    fix datetime after rounding optimizations

diff --git a/lib-python/3/datetime.py b/lib-python/3/datetime.py
--- a/lib-python/3/datetime.py
+++ b/lib-python/3/datetime.py
@@ -568,10 +568,10 @@
         if isinstance(other, timedelta):
             return usec / other._to_microseconds()
         if isinstance(other, int):
-            return timedelta(0, 0, usec / other)
+            return timedelta(0, 0, round(usec / other))
         if isinstance(other, float):
             a, b = other.as_integer_ratio()
-            return timedelta(0, 0, b * usec / a)
+            return timedelta(0, 0, round(b * usec / a))
 
     def __mod__(self, other):
         if isinstance(other, timedelta):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to