diff options
-rw-r--r-- | snekbox/api/resources/eval.py | 4 | ||||
-rw-r--r-- | snekbox/nsjail.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py index dd6f8eb..9560d0b 100644 --- a/snekbox/api/resources/eval.py +++ b/snekbox/api/resources/eval.py @@ -44,7 +44,9 @@ class EvalResource: """ Evaluate Python code and return stdout, stderr, and the return code. - The optional `args` parameter can be passed, and it would replace the "-c" option. + A list of arguments for the Python subprocess can be specified as `args`. + Otherwise, the default argument "-c" is used to execute the input code. + The input code is always passed as the last argument to Python. The return codes mostly resemble those of a Unix shell. Some noteworthy cases: diff --git a/snekbox/nsjail.py b/snekbox/nsjail.py index ca29467..ce2b28f 100644 --- a/snekbox/nsjail.py +++ b/snekbox/nsjail.py @@ -184,8 +184,8 @@ class NsJail: The `nsjail_args` passed will be used to override the values in the NsJail config. These arguments are only options for NsJail; they do not affect Python's arguments. - The `py_args` keyword argument can be given, and this would replace the "-c" argument - given by default. + `py_args` are arguments to pass to the Python subprocess before the code, + which is the last argument. By default, it's "-c", which executes the code given. """ cgroup = self._create_dynamic_cgroups() |