comparison tests/test-notify.t @ 44655:47e6ec977555

tests: prevent printing \r to stdout Like we've done in other recent commits, we need to change sys.stdout on Python 3 to not use os.linesep so output is consistent on Python 3 on Windows. With this change, test-notify.t now passes on Python 3 on Windows! Differential Revision: https://phab.mercurial-scm.org/D8342
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 29 Mar 2020 14:31:59 -0700
parents 947e6df4ff77
children af0b21d5a930
comparison
equal deleted inserted replaced
44654:d359f0d1a3d3 44655:47e6ec977555
1 $ cat > $TESTTMP/filter.py <<EOF 1 $ cat > $TESTTMP/filter.py <<EOF
2 > from __future__ import absolute_import, print_function 2 > from __future__ import absolute_import, print_function
3 > import io
3 > import re 4 > import re
4 > import sys 5 > import sys
6 > if sys.version_info[0] >= 3:
7 > sys.stdout = io.TextIOWrapper(
8 > sys.stdout.buffer,
9 > sys.stdout.encoding,
10 > sys.stdout.errors,
11 > newline="\n",
12 > line_buffering=sys.stdout.line_buffering,
13 > )
5 > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="") 14 > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="")
6 > EOF 15 > EOF
7 16
8 $ cat <<EOF >> $HGRCPATH 17 $ cat <<EOF >> $HGRCPATH
9 > [experimental] 18 > [experimental]