Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 36129:2874896a6e3b
util: format line number of stack trace using %d
Required on Python 3, functional on Python 2.
Differential Revision: https://phab.mercurial-scm.org/D2211
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 12 Feb 2018 20:43:33 -0500 |
parents | 02ed94dd9fd6 |
children | 7ec26f27ca83 |
comparison
equal
deleted
inserted
replaced
36128:02ed94dd9fd6 | 36129:2874896a6e3b |
---|---|
3157 results = [] | 3157 results = [] |
3158 for source, hook in self._hooks: | 3158 for source, hook in self._hooks: |
3159 results.append(hook(*args)) | 3159 results.append(hook(*args)) |
3160 return results | 3160 return results |
3161 | 3161 |
3162 def getstackframes(skip=0, line=' %-*s in %s\n', fileline='%s:%s', depth=0): | 3162 def getstackframes(skip=0, line=' %-*s in %s\n', fileline='%s:%d', depth=0): |
3163 '''Yields lines for a nicely formatted stacktrace. | 3163 '''Yields lines for a nicely formatted stacktrace. |
3164 Skips the 'skip' last entries, then return the last 'depth' entries. | 3164 Skips the 'skip' last entries, then return the last 'depth' entries. |
3165 Each file+linenumber is formatted according to fileline. | 3165 Each file+linenumber is formatted according to fileline. |
3166 Each line is formatted according to line. | 3166 Each line is formatted according to line. |
3167 If line is None, it yields: | 3167 If line is None, it yields: |