0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/fixtures/spawn_closed_stdio.py
Bartosz Sosnowski bd496e0187
src: ensure that fd 0-2 are valid on windows
Check that stdin, stdout and stderr are valid file descriptors on
Windows. If not, reopen them with 'nul' file.

Refs: https://github.com/nodejs/node/pull/875
Fixes: https://github.com/nodejs/node/issues/11656
PR-URL: https://github.com/nodejs/node/pull/11863
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-20 20:48:14 +01:00

9 lines
150 B
Python

import os
import sys
import subprocess
os.close(0)
os.close(1)
os.close(2)
exit_code = subprocess.call(sys.argv[1:], shell=False)
sys.exit(exit_code)