tests/testlib/sigpipe-remote.py
changeset 47637 d0c0d7b98014
parent 47636 b2ed9480b34a
child 48875 6000f5b25c9b
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)