Mercurial > public > mercurial-scm > hg-stable
diff tests/test-context.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 | 8a0cac20a1ad |
children | feced1629f48 |
line wrap: on
line diff
--- a/tests/test-context.py Mon Mar 05 15:07:32 2018 -0500 +++ b/tests/test-context.py Mon Mar 05 12:30:20 2018 -0500 @@ -1,5 +1,6 @@ from __future__ import absolute_import, print_function import os +import stat from mercurial.node import hex from mercurial import ( context, @@ -170,7 +171,8 @@ # touch 00manifest.i mtime so storecache could expire. # repo.__dict__['manifestlog'] is deleted by transaction releasefn. st = repo.svfs.stat('00manifest.i') - repo.svfs.utime('00manifest.i', (st.st_mtime + 1, st.st_mtime + 1)) + repo.svfs.utime('00manifest.i', + (st[stat.ST_MTIME] + 1, st[stat.ST_MTIME] + 1)) # read the file just committed try: