Mercurial > public > mercurial-scm > hg
comparison tests/testlib/sigpipe-remote.py @ 47637:d0c0d7b98014
sigpipe-remote: display more information about the non-py3 python
If we are running the wrong things, it is useful to know which wrong thing we
are running.
Differential Revision: https://phab.mercurial-scm.org/D11079
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 11 Jul 2021 15:41:18 +0200 |
parents | b2ed9480b34a |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
47636:b2ed9480b34a | 47637:d0c0d7b98014 |
---|---|
8 import time | 8 import time |
9 | 9 |
10 # we cannot use mercurial.testing as long as python2 is not dropped as the test | 10 # we cannot use mercurial.testing as long as python2 is not dropped as the test |
11 # will only install the mercurial module for python2 in python2 run | 11 # will only install the mercurial module for python2 in python2 run |
12 if sys.version_info[0] < 3: | 12 if sys.version_info[0] < 3: |
13 ver = '.'.join(str(x) for x in sys.version_info) | |
14 exe = sys.executable | |
13 print('SIGPIPE-HELPER: script should run with Python 3', file=sys.stderr) | 15 print('SIGPIPE-HELPER: script should run with Python 3', file=sys.stderr) |
16 print('SIGPIPE-HELPER: %s is running %s' % (exe, ver), file=sys.stderr) | |
14 sys.exit(255) | 17 sys.exit(255) |
15 | 18 |
16 if isinstance(sys.stdout.buffer, io.BufferedWriter): | 19 if isinstance(sys.stdout.buffer, io.BufferedWriter): |
17 print('SIGPIPE-HELPER: script need unbuffered output', file=sys.stderr) | 20 print('SIGPIPE-HELPER: script need unbuffered output', file=sys.stderr) |
18 sys.exit(255) | 21 sys.exit(255) |