# HG changeset patch # User Pierre-Yves David # Date 2023-02-03 00:04:22 # Node ID 88362b8bc4760dd25e7d29d83841b5d5ddd5953e # Parent 7200a9d4ea045c6b2be327f2edea9eef9ae6ab53 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. diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -1907,7 +1907,7 @@ def debugindex(ui, repo, file_=None, **o fm = ui.formatter(b'debugindex', opts) - revlog = getattr(store, b'_revlog', store) + revlog = getattr(store, '_revlog', store) return revlog_debug.debug_index( ui,