changeset 39423:f57682dca1c1

tests: avoid shellquoting bytes on Python 3 Should fix Python 3 builder. Differential Revision: https://phab.mercurial-scm.org/D4444
author Augie Fackler <augie@google.com>
date Sat, 01 Sep 2018 11:06:47 -0400
parents a80b8832720d
children 452790284a15
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Sep 01 17:37:52 2018 -0400
+++ b/tests/run-tests.py	Sat Sep 01 11:06:47 2018 -0400
@@ -1352,7 +1352,11 @@
         if PYTHON3:
             session = session.encode('ascii')
         def toggletrace(cmd):
-            quoted = shellquote(cmd.strip()).replace(b'\\', b'\\\\')
+            if isinstance(cmd, str):
+                quoted = shellquote(cmd.strip())
+            else:
+                quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
+            quoted = quoted.replace(b'\\', b'\\\\')
             if active:
                 script.append(
                     b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (