Skip to content
Snippets Groups Projects
Commit d5fc1b59 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

sigpipe-remote: verify the script is IO are unbuffered

We don't want to get stuck anywhere by buffers.

Differential Revision: https://phab.mercurial-scm.org/D11086
parent df6148ca
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
from __future__ import print_function
import io
import os
import subprocess
import sys
......@@ -9,6 +10,10 @@
# we cannot use mercurial.testing as long as python2 is not dropped as the test will only install the mercurial module for python2 in python2 run
if isinstance(sys.stdout.buffer, io.BufferedWriter):
print('SIGPIPE-HELPER: script need unbuffered output', file=sys.stderr)
sys.exit(255)
DEBUG_FILE = os.environ.get('SIGPIPE_REMOTE_DEBUG_FILE')
if DEBUG_FILE is None:
debug_stream = sys.stderr.buffer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment