Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 36130:7ec26f27ca83
util: convert traceback-related sysstrs to sysbytes in getstackframes
With this change, test-devel-warnings.t passes except for differences
in how ProgrammingError is formatted and one mysterious traceback
inside of transaction.__del__.
Differential Revision: https://phab.mercurial-scm.org/D2212
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 12 Feb 2018 20:44:06 -0500 |
parents | 2874896a6e3b |
children | d879aab17786 |
comparison
equal
deleted
inserted
replaced
36129:2874896a6e3b | 36130:7ec26f27ca83 |
---|---|
3169 filepath+linenumber, | 3169 filepath+linenumber, |
3170 function | 3170 function |
3171 | 3171 |
3172 Not be used in production code but very convenient while developing. | 3172 Not be used in production code but very convenient while developing. |
3173 ''' | 3173 ''' |
3174 entries = [(fileline % (fn, ln), func) | 3174 entries = [(fileline % (pycompat.sysbytes(fn), ln), pycompat.sysbytes(func)) |
3175 for fn, ln, func, _text in traceback.extract_stack()[:-skip - 1] | 3175 for fn, ln, func, _text in traceback.extract_stack()[:-skip - 1] |
3176 ][-depth:] | 3176 ][-depth:] |
3177 if entries: | 3177 if entries: |
3178 fnmax = max(len(entry[0]) for entry in entries) | 3178 fnmax = max(len(entry[0]) for entry in entries) |
3179 for fnln, func in entries: | 3179 for fnln, func in entries: |