Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 46079:e614eeb794f9 stable
ui: remove excessive strtolocal() from debuguigetpass
ui.getpass() returns Optional[bytes], and strtolocal(bytes) would crash.
Follows up 07b0a687c01a "ui: ensure `getpass()` returns bytes."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 03 Dec 2020 18:42:23 +0900 |
parents | 07b0a687c01a |
children | d6afa9c149c3 |
comparison
equal
deleted
inserted
replaced
46029:dadbd01f9393 | 46079:e614eeb794f9 |
---|---|
3785 norepo=True, | 3785 norepo=True, |
3786 ) | 3786 ) |
3787 def debuguigetpass(ui, prompt=b''): | 3787 def debuguigetpass(ui, prompt=b''): |
3788 """show prompt to type password""" | 3788 """show prompt to type password""" |
3789 r = ui.getpass(prompt) | 3789 r = ui.getpass(prompt) |
3790 if r is not None: | 3790 if r is None: |
3791 r = encoding.strtolocal(r) | |
3792 else: | |
3793 r = b"<default response>" | 3791 r = b"<default response>" |
3794 ui.writenoi18n(b'response: %s\n' % r) | 3792 ui.writenoi18n(b'response: %s\n' % r) |
3795 | 3793 |
3796 | 3794 |
3797 @command( | 3795 @command( |