[Python-checkins] cpython (merge 2.7 -> 2.7): Branch merge

eric.araujo python-checkins at python.org
Tue Aug 2 20:02:43 CEST 2011


http://hg.python.org/cpython/rev/4d39e6f22bef
changeset: 71700:4d39e6f22bef
branch: 2.7
parent: 71694:2aa8dd4df650
parent: 71699:aebe3243bb2c
user: Éric Araujo <merwok at netwok.org>
date: Tue Aug 02 20:01:54 2011 +0200
summary:
 Branch merge
files:
 Lib/distutils/dep_util.py | 7 ++++---
 Misc/ACKS | 1 +
 Misc/NEWS | 2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Lib/distutils/dep_util.py b/Lib/distutils/dep_util.py
--- a/Lib/distutils/dep_util.py
+++ b/Lib/distutils/dep_util.py
@@ -7,6 +7,7 @@
 __revision__ = "$Id$"
 
 import os
+from stat import ST_MTIME
 from distutils.errors import DistutilsFileError
 
 def newer(source, target):
@@ -27,7 +28,7 @@
 if not os.path.exists(target):
 return True
 
- return os.stat(source).st_mtime > os.stat(target).st_mtime
+ return os.stat(source)[ST_MTIME] > os.stat(target)[ST_MTIME]
 
 def newer_pairwise(sources, targets):
 """Walk two filename lists in parallel, testing if each source is newer
@@ -71,7 +72,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.
- target_mtime = os.stat(target).st_mtime
+ target_mtime = os.stat(target)[ST_MTIME]
 
 for source in sources:
 if not os.path.exists(source):
@@ -82,7 +83,7 @@
 elif missing == 'newer': # missing source means target is
 return True # out-of-date
 
- if os.stat(source).st_mtime > target_mtime:
+ if os.stat(source)[ST_MTIME] > target_mtime:
 return True
 
 return False
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -309,6 +309,7 @@
 Eddy De Greef
 Duncan Grisby
 Fabian Groffen
+John S. Gruber
 Dag Gruneau
 Filip Gruszczyński
 Michael Guravage
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,8 @@
 Library
 -------
 
+- Issue #11933: Fix incorrect mtime comparison in distutils.
+
 - Issues #11104, #8688: Fix the behavior of distutils' sdist command with
 manually-maintained MANIFEST files.
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /