Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 43877:e63b27fb0595
ui: convert exception data to bytes when printing chained exception info
Caught by pytype.
Differential Revision: https://phab.mercurial-scm.org/D7670
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 14 Dec 2019 18:31:50 -0500 |
parents | e5f69e3bb3f6 |
children | dbaf9aabfb69 |
comparison
equal
deleted
inserted
replaced
43876:e5f69e3bb3f6 | 43877:e63b27fb0595 |
---|---|
1855 exconly = traceback.format_exception_only(cause[0], cause[1]) | 1855 exconly = traceback.format_exception_only(cause[0], cause[1]) |
1856 | 1856 |
1857 # exclude frame where 'exc' was chained and rethrown from exctb | 1857 # exclude frame where 'exc' was chained and rethrown from exctb |
1858 self.write_err( | 1858 self.write_err( |
1859 b'Traceback (most recent call last):\n', | 1859 b'Traceback (most recent call last):\n', |
1860 b''.join(exctb[:-1]), | 1860 encoding.strtolocal(''.join(exctb[:-1])), |
1861 b''.join(causetb), | 1861 encoding.strtolocal(''.join(causetb)), |
1862 b''.join(exconly), | 1862 encoding.strtolocal(''.join(exconly)), |
1863 ) | 1863 ) |
1864 else: | 1864 else: |
1865 output = traceback.format_exception(exc[0], exc[1], exc[2]) | 1865 output = traceback.format_exception(exc[0], exc[1], exc[2]) |
1866 self.write_err(encoding.strtolocal(''.join(output))) | 1866 self.write_err(encoding.strtolocal(''.join(output))) |
1867 return self.tracebackflag or force | 1867 return self.tracebackflag or force |