tests: Pythonize env_wrapper.sh, clean up local_test
parent
a717c5406c
commit
8f1f3de123
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
# This script exists to test the behavior of Stream.python_path being set to a
|
||||
# list. It sets an environmnt variable that we can detect, then executes any
|
||||
# arguments passed to it.
|
||||
export EXECUTED_VIA_ENV_WRAPPER=1
|
||||
if [ "${1:0:1}" == "-" ]; then
|
||||
exec "$PYTHON" "$@"
|
||||
else
|
||||
export ENV_WRAPPER_FIRST_ARG="$1"
|
||||
shift
|
||||
exec "$@"
|
||||
fi
|
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
os.environ['ORIGINAL_ARGV'] = json.dumps(sys.argv)
|
||||
os.environ['THIS_IS_STUB_PYTHON'] = '1'
|
||||
|
||||
if sys.argv[1].startswith('-'):
|
||||
os.execvp(sys.executable, [sys.executable] + sys.argv[1:])
|
||||
else:
|
||||
os.environ['STUB_PYTHON_FIRST_ARG'] = sys.argv.pop(1)
|
||||
os.execvp(sys.executable, sys.argv[1:])
|
Loading…
Reference in New Issue