Commit 30748a06 by Ned Batchelder

Try to find the sandbox in a few places.

parent 716a97ea
......@@ -14,24 +14,23 @@ from .util import temp_directory
# TODO: limit too much stdout data?
DEBUG = False
STRICT = True
# Configure the Python command
SANDBOX_PYTHON = "/usr/bin/python-sandbox"
if os.path.exists(SANDBOX_PYTHON):
# Python -S inhibits loading site.py, which prevent Ubuntu from adding
# specialized traceback handlers that fail in the sandbox.
PYTHON_CMD = [
'sudo', '-u', 'sandbox',
SANDBOX_PYTHON, '-S'
]
elif STRICT:
raise Exception("Couldn't find Python sandbox")
SANDBOX_POSSIBILITIES = [
"~/mitx_all/python-sandbox/bin/python",
"/usr/bin/python-sandbox",
]
for sandbox_python in SANDBOX_POSSIBILITIES:
sandbox_python = os.path.expanduser(sandbox_python)
if os.path.exists(sandbox_python):
PYTHON_CMD = [
'sudo', '-u', 'sandbox',
sandbox_python, '-E',
]
break
else:
PYTHON_CMD = ['python', '-S']
raise Exception("Couldn't find Python sandbox")
class JailResult(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment