aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ToxicKidz <[email protected]>2021-05-19 08:47:51 -0400
committerGravatar ToxicKidz <[email protected]>2021-05-19 08:47:51 -0400
commit497f27b07c613b0cec42cad484e2e1540968871f (patch)
tree8b6074087065aa3ec60cef2d31bf823819040f2e
parentchore: Update the Nsjail.python3 docstring to use nsjail_args (diff)
chore: Apply suggestions to improve documentation
Co-authored-by: Mark <[email protected]>
-rw-r--r--snekbox/api/resources/eval.py4
-rw-r--r--snekbox/nsjail.py4
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()