Mercurial > hg
changeset 36121:3a763d7f40e1
py3: make dummyssh compatible with Python 3
Required encoding a str to bytes and writing bytes to a file
descriptor.
Differential Revision: https://phab.mercurial-scm.org/D2170
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 19:11:17 -0800 |
parents | 54dfb65e2f82 |
children | 7db243288afb |
files | tests/dummyssh |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/dummyssh Sun Feb 11 18:58:45 2018 -0800 +++ b/tests/dummyssh Sun Feb 11 19:11:17 2018 -0800 @@ -15,8 +15,8 @@ log = open("dummylog", "ab") log.write(b"Got arguments") for i, arg in enumerate(sys.argv[1:]): - log.write(b" %d:%s" % (i + 1, arg)) -log.write("\n") + log.write(b" %d:%s" % (i + 1, arg.encode('latin1'))) +log.write(b"\n") log.close() hgcmd = sys.argv[2] if os.name == 'nt':