comparison tests/run-tests.py @ 39396: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 b64d36e5ca31
children 66b5ded95185
comparison
equal deleted inserted replaced
39395:a80b8832720d 39396:f57682dca1c1
1350 active = [] 1350 active = []
1351 session = str(uuid.uuid4()) 1351 session = str(uuid.uuid4())
1352 if PYTHON3: 1352 if PYTHON3:
1353 session = session.encode('ascii') 1353 session = session.encode('ascii')
1354 def toggletrace(cmd): 1354 def toggletrace(cmd):
1355 quoted = shellquote(cmd.strip()).replace(b'\\', b'\\\\') 1355 if isinstance(cmd, str):
1356 quoted = shellquote(cmd.strip())
1357 else:
1358 quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
1359 quoted = quoted.replace(b'\\', b'\\\\')
1356 if active: 1360 if active:
1357 script.append( 1361 script.append(
1358 b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % ( 1362 b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
1359 session, active[0])) 1363 session, active[0]))
1360 script.append( 1364 script.append(