# HG changeset patch # User Matt Harbison # Date 2018-12-02 02:42:48 # Node ID 0605726179a094ef88439a060aa22bb6db0fd14a # Parent 5cbb74999040905c12dff2695817f7e19c841a4d 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. diff --git a/tests/seq.py b/tests/seq.py --- a/tests/seq.py +++ b/tests/seq.py @@ -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