diff -r 028b61c4f926 Lib/distutils/dep_util.py --- a/Lib/distutils/dep_util.py Wed Nov 16 09:54:19 2011 +0200 +++ b/Lib/distutils/dep_util.py Thu Nov 17 12:22:44 2011 +0100 @@ -20,11 +20,9 @@ if not os.path.exists(target): return 1 - from stat import ST_MTIME - mtime1 = os.stat(source)[ST_MTIME] - mtime2 = os.stat(target)[ST_MTIME] - - return mtime1 > mtime2 + mtime_source = float("%.2f" % os.stat(source).st_mtime) + mtime_target = float("%.2f" % os.stat(target).st_mtime) + return mtime_source > mtime_target # newer () @@ -72,8 +70,7 @@ # is more recent than 'target', then 'target' is out-of-date and # we can immediately return true. If we fall through to the end # of the loop, then 'target' is up-to-date and we return false. - from stat import ST_MTIME - target_mtime = os.stat(target)[ST_MTIME] + target_mtime = float("%.2f" % os.stat(target).st_mtime) for source in sources: if not os.path.exists(source): if missing == 'error': # blow up when we stat() the file @@ -82,9 +79,8 @@ continue # target's dependency list elif missing == 'newer': # missing source means target is return 1 # out-of-date - - source_mtime = os.stat(source)[ST_MTIME] - if source_mtime > target_mtime: + mtime_source = float("%.2f" % os.stat(source).st_mtime) + if mtime_source > target_mtime: return 1 else: return 0 diff -r 028b61c4f926 Lib/distutils/file_util.py --- a/Lib/distutils/file_util.py Wed Nov 16 09:54:19 2011 +0200 +++ b/Lib/distutils/file_util.py Thu Nov 17 12:22:44 2011 +0100 @@ -97,8 +97,7 @@ # (not update) and (src newer than dst). from distutils.dep_util import newer - from stat import ST_ATIME, ST_MTIME, ST_MODE, S_IMODE - + from stat import S_IMODE if not os.path.isfile(src): raise DistutilsFileError( "can't copy '%s': doesn't exist or not a regular file" % src) @@ -147,9 +146,11 @@ # According to David Ascher , utime() should be done # before chmod() (at least under NT). if preserve_times: - os.utime(dst, (st[ST_ATIME], st[ST_MTIME])) + atime_source=float("%.2f" % st.st_atime) + mtime_source=float("%.2f" % st.st_mtime) + os.utime(dst, (atime_source, mtime_source)) if preserve_mode: - os.chmod(dst, S_IMODE(st[ST_MODE])) + os.chmod(dst, S_IMODE(st.st_mode)) return (dst, 1)