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/hg.py Thu Feb 02 17:26:23 2023 +0100
+++ b/mercurial/hg.py Thu Feb 02 17:26:32 2023 +0100
@@ -1567,7 +1567,7 @@
def remoteui(src, opts):
"""build a remote ui from ui or repo and opts"""
- if util.safehasattr(src, b'baseui'): # looks like a repository
+ if util.safehasattr(src, 'baseui'): # looks like a repository
dst = src.baseui.copy() # drop repo-specific config
src = src.ui # copy target options from repo
else: # assume it's a global ui object