# HG changeset patch # User Pierre-Yves David # Date 1675354882 -3600 # Node ID 9342271eef31ae21d05dfe60ccd0254fbbb24cb6 # Parent 48e69a05675470d74187ddad37d8d4b17a6e470b 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 48e69a056754 -r 9342271eef31 mercurial/commandserver.py --- a/mercurial/commandserver.py Thu Feb 02 17:21:14 2023 +0100 +++ b/mercurial/commandserver.py Thu Feb 02 17:21:22 2023 +0100 @@ -588,7 +588,7 @@ o = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM) self._mainipc, self._workeripc = o self._servicehandler.bindsocket(self._sock, self.address) - if util.safehasattr(procutil, b'unblocksignal'): + if util.safehasattr(procutil, 'unblocksignal'): procutil.unblocksignal(signal.SIGCHLD) o = signal.signal(signal.SIGCHLD, self._sigchldhandler) self._oldsigchldhandler = o