[pypy-commit] pypy win32-cleanup2: make os.utime() subsecond-accurate

mattip noreply at buildbot.pypy.org
Thu Apr 5 01:18:43 CEST 2012


Author: Matti Picus <matti.picus at gmail.com>
Branch: win32-cleanup2
Changeset: r54189:571fd39e0a35
Date: 2012-04-05 02:18 +0300
http://bitbucket.org/pypy/pypy/changeset/571fd39e0a35/

Log:	make os.utime() subsecond-accurate

diff --git a/pypy/rpython/module/ll_os_stat.py b/pypy/rpython/module/ll_os_stat.py
--- a/pypy/rpython/module/ll_os_stat.py
+++ b/pypy/rpython/module/ll_os_stat.py
@@ -455,6 +455,6 @@
     return intmask(time), intmask(nsec)
 
 def time_t_to_FILE_TIME(time, filetime):
-    ft = (rffi.r_longlong(time) + secs_between_epochs) * 10000000
+    ft = rffi.r_longlong(time * 10000000) + secs_between_epochs * 10000000
     filetime.c_dwHighDateTime = rffi.r_uint(ft >> 32)
     filetime.c_dwLowDateTime = rffi.r_uint(ft)    # masking off high bits


More information about the pypy-commit mailing list