Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 50614:88362b8bc476
safehasattr: pass attribute name as string instead of bytes
This is a step toward replacing `util.safehasattr` usage with plain `hasattr`.
The builtin function behave poorly in Python2 but this was fixed in Python3.
These change are done one by one as they tend to have a small odd to trigger
puzzling breackage.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 03 Feb 2023 01:04:22 +0100 |
parents | 1ea84989c389 |
children | 2704dc40cf10 |
comparison
equal
deleted
inserted
replaced
50613:7200a9d4ea04 | 50614:88362b8bc476 |
---|---|
1905 opts = pycompat.byteskwargs(opts) | 1905 opts = pycompat.byteskwargs(opts) |
1906 store = cmdutil.openstorage(repo, b'debugindex', file_, opts) | 1906 store = cmdutil.openstorage(repo, b'debugindex', file_, opts) |
1907 | 1907 |
1908 fm = ui.formatter(b'debugindex', opts) | 1908 fm = ui.formatter(b'debugindex', opts) |
1909 | 1909 |
1910 revlog = getattr(store, b'_revlog', store) | 1910 revlog = getattr(store, '_revlog', store) |
1911 | 1911 |
1912 return revlog_debug.debug_index( | 1912 return revlog_debug.debug_index( |
1913 ui, | 1913 ui, |
1914 repo, | 1914 repo, |
1915 formatter=fm, | 1915 formatter=fm, |