# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-06-18 09:57:34 # Node ID bf953d218a91ba7aa4c5484a61165bd8a2221feb # Parent 06c85cbd682490189814d5f1b186bc45af5c5351 py3: encode sys.argv to bytes using .encode() Differential Revision: https://phab.mercurial-scm.org/D3787 diff --git a/tests/test-import-context.t b/tests/test-import-context.t --- a/tests/test-import-context.t +++ b/tests/test-import-context.t @@ -10,7 +10,7 @@ Test applying context diffs > fp = open(path, 'wb') > for i, pattern in enumerate(patterns): > count = int(pattern[0:-1]) - > char = pattern[-1] + '\n' + > char = pattern[-1].encode('utf8') + b'\n' > if not lasteol and i == len(patterns) - 1: > fp.write((char*count)[:-1]) > else: diff --git a/tests/test-patch-offset.t b/tests/test-patch-offset.t --- a/tests/test-patch-offset.t +++ b/tests/test-patch-offset.t @@ -8,7 +8,7 @@ > fp = open(path, 'wb') > for pattern in patterns: > count = int(pattern[0:-1]) - > char = pattern[-1] + '\n' + > char = pattern[-1].encode('utf8') + b'\n' > fp.write(char*count) > fp.close() > EOF