Mercurial > public > mercurial-scm > hg
comparison mercurial/chgserver.py @ 50552:b0e3f1508a25
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:19:55 +0100 |
parents | 62a1ef6d2811 |
children | defd2b3eafdb |
comparison
equal
deleted
inserted
replaced
50551:62a1ef6d2811 | 50552:b0e3f1508a25 |
---|---|
601 b'setumask': setumask, | 601 b'setumask': setumask, |
602 b'setumask2': setumask2, | 602 b'setumask2': setumask2, |
603 } | 603 } |
604 ) | 604 ) |
605 | 605 |
606 if util.safehasattr(procutil, b'setprocname'): | 606 if util.safehasattr(procutil, 'setprocname'): |
607 | 607 |
608 def setprocname(self): | 608 def setprocname(self): |
609 """Change process title""" | 609 """Change process title""" |
610 name = self._readstr() | 610 name = self._readstr() |
611 self.ui.log(b'chgserver', b'setprocname: %r\n', name) | 611 self.ui.log(b'chgserver', b'setprocname: %r\n', name) |