[pypy-issue] [issue1092] 1.8.0 datetime.timedelta issue

Amaury Forgeot d Arc tracker at bugs.pypy.org
Fri Mar 16 08:23:19 CET 2012


Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

This was already fixed in 8a9843bb99ad.
This part of the diff is relevant, if you want to modify your copy of datetime.py:

--- a/lib_pypy/datetime.py	Sun Jan 22 10:33:03 2012 +0100
+++ b/lib_pypy/datetime.py	Fri Feb 10 01:19:56 2012 +0100
@@ -1520,7 +1520,7 @@
     def utcfromtimestamp(cls, t):
         "Construct a UTC datetime from a POSIX timestamp (like time.time())."
         t, frac = divmod(t, 1.0)
-        us = round(frac * 1e6)
+        us = int(round(frac * 1e6))
 
         # If timestamp is less than one microsecond smaller than a
         # full second, us can be rounded up to 1000000.  In this case,

----------
nosy: +afa
status: unread -> resolved

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1092>
________________________________________


More information about the pypy-issue mailing list