Mercurial > hg-stable
changeset 50589:ef5435e7604e
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:21:04 +0100 |
parents | 6e749d4abf05 |
children | 48e69a056754 |
files | mercurial/commandserver.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commandserver.py Thu Feb 02 17:20:54 2023 +0100 +++ b/mercurial/commandserver.py Thu Feb 02 17:21:04 2023 +0100 @@ -384,7 +384,7 @@ if self.cmsg: hellomsg += b'message-encoding: %s\n' % self.cmsg.encoding hellomsg += b'pid: %d' % procutil.getpid() - if util.safehasattr(os, b'getpgid'): + if util.safehasattr(os, 'getpgid'): hellomsg += b'\n' hellomsg += b'pgid: %d' % os.getpgid(0)