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/commandserver.py Thu Feb 02 17:21:04 2023 +0100
+++ b/mercurial/commandserver.py Thu Feb 02 17:21:14 2023 +0100
@@ -559,7 +559,7 @@
self.ui = ui
self.repo = repo
self.address = opts[b'address']
- if not util.safehasattr(socket, b'AF_UNIX'):
+ if not util.safehasattr(socket, 'AF_UNIX'):
raise error.Abort(_(b'unsupported platform'))
if not self.address:
raise error.Abort(_(b'no socket path specified with --address'))