changeset 50592:0f83dc22efbc

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 Thu, 02 Feb 2023 17:34:17 +0100
parents 886d05ed9a46
children 5ae124310ab0
files mercurial/phases.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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))