Debian Codegraph @

rpython/translator/sandbox/interact.py

raw symbols SCIP
1 #! /usr/bin/env python
2
3 """Interacts with a subprocess translated with --sandbox.
4 The subprocess is only allowed to use stdin/stdout/stderr.
5
6 Usage:
7 interact.py <executable> <args...>
8 """
9 from __future__ import print_function
10
11 import sys
12 from rpython.translator.sandbox.sandlib import SimpleIOSandboxedProc
13
14 if __name__ == '__main__':
15 if len(sys.argv) < 2:
16 print(__doc__, file=sys.stderr)
17 sys.exit(2)
18 SimpleIOSandboxedProc(sys.argv[1:]).interact()