Mercurial > hg
comparison tests/printenv.py @ 7080:a6477aa893b8
tests: Windows compatibility fixes
- printenv.py, md5sum.py, simplemerge, test-archive, test-merge1,
test-merge-symlinks: set standard streams to binary mode
- test-encode: replace "gunzip" by "gzip -d"
- test-hup: requires fifo
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 12 Oct 2008 19:11:59 +0200 |
parents | 7a7d4937272b |
children | f77c8d8331ca |
comparison
equal
deleted
inserted
replaced
7079:0b74409d5858 | 7080:a6477aa893b8 |
---|---|
13 # - [output] is the name of the output file (default: use sys.stdout) | 13 # - [output] is the name of the output file (default: use sys.stdout) |
14 # the file will be opened in append mode. | 14 # the file will be opened in append mode. |
15 # | 15 # |
16 import os | 16 import os |
17 import sys | 17 import sys |
18 | |
19 try: | |
20 import msvcrt | |
21 msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) | |
22 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
23 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) | |
24 except ImportError: | |
25 pass | |
18 | 26 |
19 exitcode = 0 | 27 exitcode = 0 |
20 out = sys.stdout | 28 out = sys.stdout |
21 | 29 |
22 name = sys.argv[1] | 30 name = sys.argv[1] |