comparison mercurial/commandserver.py @ 50588:6e749d4abf05

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:20:54 +0100
parents 48f1b314056b
children ef5435e7604e
comparison
equal deleted inserted replaced
50587:7b0cc86c5d74 50588:6e749d4abf05
330 for ui in uis: 330 for ui in uis:
331 ui.resetstate() 331 ui.resetstate()
332 # any kind of interaction must use server channels, but chg may 332 # any kind of interaction must use server channels, but chg may
333 # replace channels by fully functional tty files. so nontty is 333 # replace channels by fully functional tty files. so nontty is
334 # enforced only if cin is a channel. 334 # enforced only if cin is a channel.
335 if not util.safehasattr(self.cin, b'fileno'): 335 if not util.safehasattr(self.cin, 'fileno'):
336 ui.setconfig(b'ui', b'nontty', b'true', b'commandserver') 336 ui.setconfig(b'ui', b'nontty', b'true', b'commandserver')
337 337
338 req = dispatch.request( 338 req = dispatch.request(
339 args[:], 339 args[:],
340 copiedui, 340 copiedui,