# HG changeset patch # User Augie Fackler # Date 1428791312 14400 # Node ID 1203ca7005faa257c2f916f6ec607b549317e6f5 # Parent af6e6a0781d7f8752125a2712ddad7a50d4254aa run-tests: use bytes when constructing shell script diff -r af6e6a0781d7 -r 1203ca7005fa tests/run-tests.py --- a/tests/run-tests.py Sat Apr 11 18:26:58 2015 -0400 +++ b/tests/run-tests.py Sat Apr 11 18:28:32 2015 -0400 @@ -923,37 +923,37 @@ script.append('alias pwd="pwd -W"\n') for n, l in enumerate(lines): - if not l.endswith('\n'): - l += '\n' - if l.startswith('#require'): + if not l.endswith(b'\n'): + l += b'\n' + if l.startswith(b'#require'): lsplit = l.split() - if len(lsplit) < 2 or lsplit[0] != '#require': + if len(lsplit) < 2 or lsplit[0] != b'#require': after.setdefault(pos, []).append(' !!! invalid #require\n') if not self._hghave(lsplit[1:]): script = ["exit 80\n"] break after.setdefault(pos, []).append(l) - elif l.startswith('#if'): + elif l.startswith(b'#if'): lsplit = l.split() - if len(lsplit) < 2 or lsplit[0] != '#if': + if len(lsplit) < 2 or lsplit[0] != b'#if': after.setdefault(pos, []).append(' !!! invalid #if\n') if skipping is not None: after.setdefault(pos, []).append(' !!! nested #if\n') skipping = not self._hghave(lsplit[1:]) after.setdefault(pos, []).append(l) - elif l.startswith('#else'): + elif l.startswith(b'#else'): if skipping is None: after.setdefault(pos, []).append(' !!! missing #if\n') skipping = not skipping after.setdefault(pos, []).append(l) - elif l.startswith('#endif'): + elif l.startswith(b'#endif'): if skipping is None: after.setdefault(pos, []).append(' !!! missing #if\n') skipping = None after.setdefault(pos, []).append(l) elif skipping: after.setdefault(pos, []).append(l) - elif l.startswith(' >>> '): # python inlines + elif l.startswith(b' >>> '): # python inlines after.setdefault(pos, []).append(l) prepos = pos pos = n @@ -964,10 +964,10 @@ script.append('%s -m heredoctest < '): # continuations + elif l.startswith(b' > '): # continuations after.setdefault(prepos, []).append(l) script.append(l[4:]) - elif l.startswith(' '): # results + elif l.startswith(b' '): # results # Queue up a list of expected results. expected.setdefault(pos, []).append(l[2:]) else: