Mercurial > hg-stable
changeset 50582:b1fb4185e47c
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:18:37 +0100 |
parents | 9e24f8442640 |
children | 037890ecaff5 |
files | mercurial/wireprotov1peer.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/wireprotov1peer.py Thu Feb 02 17:18:24 2023 +0100 +++ b/mercurial/wireprotov1peer.py Thu Feb 02 17:18:37 2023 +0100 @@ -483,7 +483,7 @@ 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"":