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.
--- 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))