# HG changeset patch # User Pierre-Yves David # Date 2023-02-02 16:18:37 # Node ID b1fb4185e47c16cc410abdde9a7e6135e667fb39 # Parent 9e24f8442640468dc8edc201d57d8c0f16d7bb64 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 --git a/mercurial/wireprotov1peer.py b/mercurial/wireprotov1peer.py --- a/mercurial/wireprotov1peer.py +++ b/mercurial/wireprotov1peer.py @@ -483,7 +483,7 @@ class wirepeer(repository.peer): else: heads = wireprototypes.encodelist(heads) - if util.safehasattr(bundle, b'deltaheader'): + if util.safehasattr(bundle, 'deltaheader'): # this a bundle10, do the old style call sequence ret, output = self._callpush(b"unbundle", bundle, heads=heads) if ret == b"":