# HG changeset patch # User Augie Fackler # Date 2018-09-01 15:06:47 # Node ID f57682dca1c13891ca6c9041a76c459f5b1f6dc0 # Parent a80b8832720d71c6a590c3a74d4548ce3ab21b10 tests: avoid shellquoting bytes on Python 3 Should fix Python 3 builder. Differential Revision: https://phab.mercurial-scm.org/D4444 diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1352,7 +1352,11 @@ class TTest(Test): 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' % (