##// END OF EJS Templates
py3: use bytes stdout in hghave.py...
Matt Harbison -
r41039:87c98ffb default
parent child Browse files
Show More
@@ -16,6 +16,16 b' checks = {'
16 "false": (lambda: False, "nail clipper"),
16 "false": (lambda: False, "nail clipper"),
17 }
17 }
18
18
19 try:
20 import msvcrt
21 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
22 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
23 except ImportError:
24 pass
25
26 stdout = getattr(sys.stdout, 'buffer', sys.stdout)
27 stderr = getattr(sys.stderr, 'buffer', sys.stderr)
28
19 if sys.version_info[0] >= 3:
29 if sys.version_info[0] >= 3:
20 def _bytespath(p):
30 def _bytespath(p):
21 if p is None:
31 if p is None:
@@ -90,11 +100,12 b' def require(features):'
90 result = checkfeatures(features)
100 result = checkfeatures(features)
91
101
92 for missing in result['missing']:
102 for missing in result['missing']:
93 sys.stderr.write('skipped: unknown feature: %s\n' % missing)
103 stderr.write(('skipped: unknown feature: %s\n'
104 % missing).encode('utf-8'))
94 for msg in result['skipped']:
105 for msg in result['skipped']:
95 sys.stderr.write('skipped: %s\n' % msg)
106 stderr.write(('skipped: %s\n' % msg).encode('utf-8'))
96 for msg in result['error']:
107 for msg in result['error']:
97 sys.stderr.write('%s\n' % msg)
108 stderr.write(('%s\n' % msg).encode('utf-8'))
98
109
99 if result['missing']:
110 if result['missing']:
100 sys.exit(2)
111 sys.exit(2)
General Comments 0
You need to be logged in to leave comments. Login now