Mercurial > hg
changeset 40773:0605726179a0
tests: apply binary mode to output in seq.py
I noticed this when playing with running tests using WSL, and iterating over the
output yielded '0\r', '1\r',... Most of the other *.py tools do this, and `seq`
on MSYS lacks '\r' in the output, so this is more consistent.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 01 Dec 2018 21:42:48 -0500 |
parents | 5cbb74999040 |
children | 8306dac48061 |
files | tests/seq.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/seq.py Fri Nov 23 01:09:37 2018 +0100 +++ b/tests/seq.py Sat Dec 01 21:42:48 2018 -0500 @@ -8,8 +8,17 @@ # seq START STEP STOP [START, STOP] stepping by STEP from __future__ import absolute_import, print_function +import os import sys +try: + import msvcrt + msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) + msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) + msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) +except ImportError: + pass + if sys.version_info[0] >= 3: xrange = range