diff mercurial/hgweb/common.py @ 36789:ffa3026d4196

cleanup: use stat_result[stat.ST_MTIME] instead of stat_result.st_mtime The latter is floating point by default, and we've been doing os.stat_float_times(False). Unfortunately, os.stat_float_times was removed between Python 3.7.0a1 and 3.7.0b2, so we have to stop using it. Differential Revision: https://phab.mercurial-scm.org/D2696
author Augie Fackler <augie@google.com>
date Mon, 05 Mar 2018 12:30:20 -0500
parents 6585ac350fd9
children 7066617187c1
line wrap: on
line diff
--- a/mercurial/hgweb/common.py	Mon Mar 05 15:07:32 2018 -0500
+++ b/mercurial/hgweb/common.py	Mon Mar 05 12:30:20 2018 -0500
@@ -12,6 +12,7 @@
 import errno
 import mimetypes
 import os
+import stat
 
 from .. import (
     encoding,
@@ -132,7 +133,7 @@
         return os.stat(spath)
 
 def get_mtime(spath):
-    return get_stat(spath, "00changelog.i").st_mtime
+    return get_stat(spath, "00changelog.i")[stat.ST_MTIME]
 
 def ispathsafe(path):
     """Determine if a path is safe to use for filesystem access."""