# HG changeset patch # User Pierre-Yves David # Date 1675355657 -3600 # Node ID 0f83dc22efbc5505da41c6c2065f8d84af1f1708 # Parent 886d05ed9a46817c16700ee648e843244e3db129 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 -r 886d05ed9a46 -r 0f83dc22efbc mercurial/phases.py --- a/mercurial/phases.py Thu Feb 02 17:34:09 2023 +0100 +++ b/mercurial/phases.py Thu Feb 02 17:34:17 2023 +0100 @@ -463,11 +463,11 @@ def replace(self, phcache): """replace all values in 'self' with content of phcache""" for a in ( - b'phaseroots', - b'dirty', - b'opener', - b'_loadedrevslen', - b'_phasesets', + 'phaseroots', + 'dirty', + 'opener', + '_loadedrevslen', + '_phasesets', ): setattr(self, a, getattr(phcache, a))