# HG changeset patch # User Sean Farley # Date 1444777530 25200 # Node ID 6331a0c310db8ad85cdd4c95709b41fc03bd79ad # Parent 640b807dcce0c70f39b3e48918ed7fe35d69f0d8 util: also catch IndexError This makes life so, so much easier for hgwatchman, which provides a named tuple but throws an IndexError instead of a TypeError. diff -r 640b807dcce0 -r 6331a0c310db mercurial/util.py --- a/mercurial/util.py Wed Oct 14 12:23:49 2015 +0200 +++ b/mercurial/util.py Tue Oct 13 16:05:30 2015 -0700 @@ -963,7 +963,7 @@ """ try: return st[stat.ST_MTIME] - except TypeError: + except (TypeError, IndexError): # osutil.stat doesn't allow index access and its st_mtime is int return st.st_mtime