py3: encode sys.argv to bytes using .encode()
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 18 Jun 2018 15:27:34 +0530
changeset 38365 bf953d218a91
parent 38364 06c85cbd6824
child 38366 4a6d01b49d91
py3: encode sys.argv to bytes using .encode() Differential Revision: https://phab.mercurial-scm.org/D3787
tests/test-import-context.t
tests/test-patch-offset.t
--- a/tests/test-import-context.t	Mon Jun 18 15:25:57 2018 +0530
+++ b/tests/test-import-context.t	Mon Jun 18 15:27:34 2018 +0530
@@ -10,7 +10,7 @@
   > 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:
--- a/tests/test-patch-offset.t	Mon Jun 18 15:25:57 2018 +0530
+++ b/tests/test-patch-offset.t	Mon Jun 18 15:27:34 2018 +0530
@@ -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